mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-09 08:15:05 +01:00
5d5ea15a65
For #159805 This splits the markdown server into two main functions: - `startVsCodeServer` which assumes the client can implement all the functionality of VS Code. It is not specific to VS Code however, the client just need to implement the custom messages that VS Code does - `startServer` which lets you pass in your own implementation of the parser and workspace. A consumer of the server can then use this to have their own custom server implementation, which might use normal node apis to read files
20 lines
836 B
TypeScript
20 lines
836 B
TypeScript
/*---------------------------------------------------------------------------------------------
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
*--------------------------------------------------------------------------------------------*/
|
|
|
|
import { Connection, createConnection } from 'vscode-languageserver/node';
|
|
import { startVsCodeServer } from '../server';
|
|
|
|
// Create a connection for the server.
|
|
const connection: Connection = createConnection();
|
|
|
|
console.log = connection.console.log.bind(connection.console);
|
|
console.error = connection.console.error.bind(connection.console);
|
|
|
|
process.on('unhandledRejection', (e: any) => {
|
|
connection.console.error(`Unhandled exception ${e}`);
|
|
});
|
|
|
|
startVsCodeServer(connection);
|