mirror of
https://github.com/microsoft/vscode-extension-samples.git
synced 2026-06-13 07:10:26 +08:00
Fixes #42: lsp-sample compilation error
This commit is contained in:
15
lsp-sample/package-lock.json
generated
15
lsp-sample/package-lock.json
generated
@ -5,18 +5,21 @@
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
"@types/mocha": {
|
||||
"version": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.43.tgz",
|
||||
"integrity": "sha1-A8VFicQ60EjLy/1jmZtV0EJO7Cc=",
|
||||
"version": "2.2.48",
|
||||
"resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-2.2.48.tgz",
|
||||
"integrity": "sha512-nlK/iyETgafGli8Zh9zJVCTicvU3iajSkRwOh3Hhiva598CMqNJ4NcVCGMTGKpGpTYj/9R8RLzS9NAykSSCqGw==",
|
||||
"dev": true
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "https://registry.npmjs.org/@types/node/-/node-6.0.90.tgz",
|
||||
"integrity": "sha1-DtdIM/obc9zblAncscl+wKixOwI=",
|
||||
"version": "6.0.96",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-6.0.96.tgz",
|
||||
"integrity": "sha512-fsOOY6tMQ3jCB2wD51XFDmmpgm4wVKkJECdcVRqapbJEa7awJDcr+SaH8toz+4r4KW8YQ3M7ybXMoSDo1QGewA==",
|
||||
"dev": true
|
||||
},
|
||||
"typescript": {
|
||||
"version": "https://registry.npmjs.org/typescript/-/typescript-2.5.3.tgz",
|
||||
"integrity": "sha1-3z3Nw48764ANS8MiZGsEo/bKfw0=",
|
||||
"version": "2.7.1",
|
||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.1.tgz",
|
||||
"integrity": "sha512-bqB1yS6o9TNA9ZC/MJxM0FZzPnZdtHj0xWK/IZ5khzVqdpGul/R/EIiHRgFXlwTD7PSIaYVnGKq1QgMCu2mnqw==",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,8 +5,8 @@
|
||||
'use strict';
|
||||
|
||||
import {
|
||||
IPCMessageReader, IPCMessageWriter, createConnection, IConnection, TextDocuments, TextDocument,
|
||||
Diagnostic, DiagnosticSeverity, InitializeResult, TextDocumentPositionParams, CompletionItem,
|
||||
IPCMessageReader, IPCMessageWriter, createConnection, IConnection, TextDocuments, TextDocument,
|
||||
Diagnostic, DiagnosticSeverity, InitializeResult, TextDocumentPositionParams, CompletionItem,
|
||||
CompletionItemKind
|
||||
} from 'vscode-languageserver';
|
||||
|
||||
@ -21,10 +21,8 @@ let documents: TextDocuments = new TextDocuments();
|
||||
documents.listen(connection);
|
||||
|
||||
// After the server has started the client sends an initialize request. The server receives
|
||||
// in the passed params the rootPath of the workspace plus the client capabilities.
|
||||
let workspaceRoot: string;
|
||||
connection.onInitialize((params): InitializeResult => {
|
||||
workspaceRoot = params.rootPath;
|
||||
// in the passed params the rootPath of the workspace plus the client capabilities.
|
||||
connection.onInitialize((_params): InitializeResult => {
|
||||
return {
|
||||
capabilities: {
|
||||
// Tell the client that the server works in FULL text document sync mode
|
||||
@ -97,7 +95,7 @@ connection.onDidChangeWatchedFiles((_change) => {
|
||||
|
||||
// This handler provides the initial list of the completion items.
|
||||
connection.onCompletion((_textDocumentPosition: TextDocumentPositionParams): CompletionItem[] => {
|
||||
// The pass parameter contains the position of the text document in
|
||||
// The pass parameter contains the position of the text document in
|
||||
// which code complete got requested. For the example we ignore this
|
||||
// info and always provide the same completion items.
|
||||
return [
|
||||
|
||||
Reference in New Issue
Block a user