mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Pretter for each ts file
This commit is contained in:
@ -3,9 +3,7 @@
|
||||
*--------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {
|
||||
createConnection, TextDocuments, ProposedFeatures, TextDocumentSyncKind
|
||||
} from 'vscode-languageserver';
|
||||
import { createConnection, TextDocuments, ProposedFeatures, TextDocumentSyncKind } from 'vscode-languageserver';
|
||||
|
||||
// Creates the LSP connection
|
||||
let connection = createConnection(ProposedFeatures.all);
|
||||
@ -16,12 +14,12 @@ let documents = new TextDocuments();
|
||||
// The workspace folder this server is operating on
|
||||
let workspaceFolder: string;
|
||||
|
||||
documents.onDidOpen((event) => {
|
||||
documents.onDidOpen(event => {
|
||||
connection.console.log(`[Server(${process.pid}) ${workspaceFolder}] Document opened: ${event.document.uri}`);
|
||||
})
|
||||
});
|
||||
documents.listen(connection);
|
||||
|
||||
connection.onInitialize((params) => {
|
||||
connection.onInitialize(params => {
|
||||
workspaceFolder = params.rootUri;
|
||||
connection.console.log(`[Server(${process.pid}) ${workspaceFolder}] Started and initialize received`);
|
||||
return {
|
||||
@ -31,6 +29,6 @@ connection.onInitialize((params) => {
|
||||
change: TextDocumentSyncKind.None
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
});
|
||||
connection.listen();
|
||||
connection.listen();
|
||||
|
||||
Reference in New Issue
Block a user