From 816ebcf588cb83f5fc958ab67631131e0f32c666 Mon Sep 17 00:00:00 2001 From: Dirk Baeumer Date: Fri, 8 Sep 2017 15:32:55 +0200 Subject: [PATCH] Adopt latest lsp libraries. Introduce consistent naming --- lsp-multi-server-sample/.vscode/settings.json | 4 ++- lsp-multi-server-sample/.vscode/tasks.json | 28 +++++++++---------- lsp-multi-server-sample/client/package.json | 2 +- .../client/src/extension.ts | 6 ++-- lsp-multi-server-sample/package.json | 8 +++--- lsp-multi-server-sample/server/package.json | 2 +- lsp-multi-server-sample/server/src/server.ts | 4 +-- 7 files changed, 28 insertions(+), 26 deletions(-) diff --git a/lsp-multi-server-sample/.vscode/settings.json b/lsp-multi-server-sample/.vscode/settings.json index ed5b51ff..19fbd676 100644 --- a/lsp-multi-server-sample/.vscode/settings.json +++ b/lsp-multi-server-sample/.vscode/settings.json @@ -5,5 +5,7 @@ "search.exclude": { "out": true // set this to false to include "out" folder in search results }, - "typescript.tsdk": "./node_modules/typescript/lib" + "typescript.tsdk": "./node_modules/typescript/lib", + "typescript.tsc.autoDetect": "off", + "npm.autoDetect": "off" } \ No newline at end of file diff --git a/lsp-multi-server-sample/.vscode/tasks.json b/lsp-multi-server-sample/.vscode/tasks.json index c3bccf46..ee8f0759 100644 --- a/lsp-multi-server-sample/.vscode/tasks.json +++ b/lsp-multi-server-sample/.vscode/tasks.json @@ -2,17 +2,17 @@ "version": "2.0.0", "tasks": [ { - "taskName": "Compile", + "taskName": "compile", "dependsOn": [ - "Client Compile", - "Server Compile" + "compile:client", + "compile:server" ], "problemMatcher": [] }, { - "taskName": "Client Compile", + "taskName": "compile:client", "type": "shell", - "command": "npm run client-compile", + "command": "npm run compile:client", "group": "build", "presentation": { "panel": "dedicated", @@ -24,9 +24,9 @@ ] }, { - "taskName": "Server Compile", + "taskName": "compile:server", "type": "shell", - "command": "npm run server-compile", + "command": "npm run compile:server", "group": "build", "presentation": { "panel": "dedicated", @@ -37,10 +37,10 @@ ] }, { - "taskName": "Watch", + "taskName": "watch", "dependsOn": [ - "Client Watch", - "Server Watch" + "watch:client", + "watch:server" ], "group": { "kind": "build", @@ -49,9 +49,9 @@ "problemMatcher": [] }, { - "taskName": "Client Watch", + "taskName": "watch:client", "type": "shell", - "command": "npm run client-watch", + "command": "npm run watch:client", "isBackground": true, "group": "build", "presentation": { @@ -63,9 +63,9 @@ ] }, { - "taskName": "Server Watch", + "taskName": "watch:server", "type": "shell", - "command": "npm run server-watch", + "command": "npm run watch:server", "isBackground": true, "group": "build", "presentation": { diff --git a/lsp-multi-server-sample/client/package.json b/lsp-multi-server-sample/client/package.json index 88c95d46..43cf2d53 100644 --- a/lsp-multi-server-sample/client/package.json +++ b/lsp-multi-server-sample/client/package.json @@ -50,6 +50,6 @@ }, "dependencies": { "vscode": "^1.1.5", - "vscode-languageclient": "next" + "vscode-languageclient": "^3.4.2" } } \ No newline at end of file diff --git a/lsp-multi-server-sample/client/src/extension.ts b/lsp-multi-server-sample/client/src/extension.ts index 33f8c3b9..fe85b813 100644 --- a/lsp-multi-server-sample/client/src/extension.ts +++ b/lsp-multi-server-sample/client/src/extension.ts @@ -4,7 +4,7 @@ import { } from 'vscode'; import { - LanguageClient, LanguageClientOptions, TransportKind, ProposedProtocol + LanguageClient, LanguageClientOptions, TransportKind } from 'vscode-languageclient'; let defaultClient: LanguageClient; @@ -46,7 +46,7 @@ export function activate(context: ExtensionContext) { outputChannel: outputChannel } defaultClient = new LanguageClient('lsp-multi-server-example', 'LSP Multi Server Example', serverOptions, clientOptions); - defaultClient.registerFeatures(ProposedProtocol(defaultClient)); + defaultClient.registerProposedFeatures(); defaultClient.start(); return; } @@ -74,7 +74,7 @@ export function activate(context: ExtensionContext) { outputChannel: outputChannel } let client = new LanguageClient('lsp-multi-server-example', 'LSP Multi Server Example', serverOptions, clientOptions); - client.registerFeatures(ProposedProtocol(client)); + client.registerProposedFeatures(); client.start(); clients.set(folder.uri.toString(), client); } diff --git a/lsp-multi-server-sample/package.json b/lsp-multi-server-sample/package.json index 11080a21..22baa629 100644 --- a/lsp-multi-server-sample/package.json +++ b/lsp-multi-server-sample/package.json @@ -12,10 +12,10 @@ "scripts": { "postinstall": "cd server && npm install && cd ../client && npm install && cd ..", "compile": "tsc -p client/tsconfig.json && cd server && npm run installServer && cd .. && tsc -p server/tsconfig.json", - "client-compile": "tsc -p client/tsconfig.json", - "client-watch": "tsc -w -p client/tsconfig.json", - "server-compile": "cd server && npm run installServer && cd .. && tsc -p server/tsconfig.json", - "server-watch": "cd server && npm run installServer && cd .. && tsc -w -p server/tsconfig.json" + "compile:client": "tsc -p client/tsconfig.json", + "watch:client": "tsc -w -p client/tsconfig.json", + "compile:server": "cd server && npm run installServer && cd .. && tsc -p server/tsconfig.json", + "watch:server": "cd server && npm run installServer && cd .. && tsc -w -p server/tsconfig.json" }, "devDependencies": { "@types/mocha": "^2.2.42", diff --git a/lsp-multi-server-sample/server/package.json b/lsp-multi-server-sample/server/package.json index 47b3c0dc..b52bbdf5 100644 --- a/lsp-multi-server-sample/server/package.json +++ b/lsp-multi-server-sample/server/package.json @@ -11,7 +11,7 @@ "url": "https://github.com/Microsoft/vscode-extension-samples" }, "dependencies": { - "vscode-languageserver": "next" + "vscode-languageserver": "^3.4.2" }, "scripts": { "installServer": "installServerIntoExtension ../client ./package.json ./tsconfig.json", diff --git a/lsp-multi-server-sample/server/src/server.ts b/lsp-multi-server-sample/server/src/server.ts index 75d90320..b2f55d60 100644 --- a/lsp-multi-server-sample/server/src/server.ts +++ b/lsp-multi-server-sample/server/src/server.ts @@ -4,10 +4,10 @@ 'use strict'; import { - createConnection, TextDocuments, ProposedProtocol, TextDocumentSyncKind + createConnection, TextDocuments, ProposedFeatures, TextDocumentSyncKind } from 'vscode-languageserver'; -let connection = createConnection(ProposedProtocol); +let connection = createConnection(ProposedFeatures.all); let documents = new TextDocuments(); let rootUri: string;