Adopt latest lsp libraries. Introduce consistent naming

This commit is contained in:
Dirk Baeumer
2017-09-08 15:32:55 +02:00
parent 6aada1dbd9
commit 816ebcf588
7 changed files with 28 additions and 26 deletions

View File

@ -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"
}

View File

@ -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": {

View File

@ -50,6 +50,6 @@
},
"dependencies": {
"vscode": "^1.1.5",
"vscode-languageclient": "next"
"vscode-languageclient": "^3.4.2"
}
}

View File

@ -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);
}

View File

@ -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",

View File

@ -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",

View File

@ -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;