From ac5ce550893777b8c02ecf863e9c58cab71b4da3 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Thu, 1 Feb 2018 15:44:28 +0100 Subject: [PATCH] Fixes #42: lsp-sample compilation error --- lsp-sample/package-lock.json | 15 +++++++++------ lsp-sample/server/src/server.ts | 12 +++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/lsp-sample/package-lock.json b/lsp-sample/package-lock.json index 7dc7451c..573eb450 100644 --- a/lsp-sample/package-lock.json +++ b/lsp-sample/package-lock.json @@ -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 } } diff --git a/lsp-sample/server/src/server.ts b/lsp-sample/server/src/server.ts index 2737ddac..a86ee66c 100644 --- a/lsp-sample/server/src/server.ts +++ b/lsp-sample/server/src/server.ts @@ -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 [