[css] update language server & client

This commit is contained in:
Martin Aeschlimann 2017-08-18 18:28:02 +02:00
parent a3607bc2d2
commit 1ba52e2113
6 changed files with 12 additions and 12 deletions

View file

@ -9,7 +9,7 @@ import * as path from 'path';
import { languages, window, commands, workspace, ExtensionContext } from 'vscode';
import { LanguageClient, LanguageClientOptions, ServerOptions, TransportKind, RequestType, Range, TextEdit } from 'vscode-languageclient';
import { activateColorDecorations, ColorProvider } from './colorDecorators';
import { GetConfigurationFeature } from 'vscode-languageclient/lib/proposed';
import { ConfigurationFeature } from 'vscode-languageclient/lib/proposed';
import * as nls from 'vscode-nls';
let localize = nls.loadMessageBundle();
@ -45,7 +45,7 @@ export function activate(context: ExtensionContext) {
// Create the language client and start the client.
let client = new LanguageClient('css', localize('cssserver.name', 'CSS Language Server'), serverOptions, clientOptions);
client.registerFeature(new GetConfigurationFeature(client));
client.registerFeature(new ConfigurationFeature(client));
let disposable = client.start();
// Push the disposable to the context's subscriptions so that the

View file

@ -18,9 +18,9 @@
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.3.1.tgz"
},
"vscode-languageclient": {
"version": "3.4.0-next.4",
"version": "3.4.0-next.10",
"from": "vscode-languageclient@next",
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.4.0-next.4.tgz"
"resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-3.4.0-next.10.tgz"
},
"vscode-languageserver-types": {
"version": "3.3.0",

View file

@ -735,10 +735,10 @@
},
"dependencies": {
"parse-color": "^1.0.0",
"vscode-languageclient": "^3.4.0-next.4",
"vscode-languageclient": "3.4.0-next.10",
"vscode-nls": "^2.0.2"
},
"devDependencies": {
"@types/node": "^6.0.51"
}
}
}

View file

@ -13,9 +13,9 @@
"resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-3.3.1.tgz"
},
"vscode-languageserver": {
"version": "3.4.0-next.2",
"version": "3.4.0-next.4",
"from": "vscode-languageserver@next",
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.4.0-next.2.tgz"
"resolved": "https://registry.npmjs.org/vscode-languageserver/-/vscode-languageserver-3.4.0-next.4.tgz"
},
"vscode-languageserver-types": {
"version": "3.3.0",

View file

@ -9,7 +9,7 @@
},
"dependencies": {
"vscode-css-languageservice": "^2.1.3",
"vscode-languageserver": "^3.4.0-next.2"
"vscode-languageserver": "3.4.0-next.4"
},
"devDependencies": {
"@types/node": "^6.0.51"

View file

@ -57,7 +57,7 @@ connection.onInitialize((params: InitializeParams): InitializeResult => {
return !!c;
}
let snippetSupport = hasClientCapability('textDocument.completion.completionItem.snippetSupport');
scopedSettingsSupport = hasClientCapability('workspace.getConfiguration');
scopedSettingsSupport = hasClientCapability('workspace.configuration');
return {
capabilities: {
// Tell the client that the server works in FULL text document sync mode
@ -94,8 +94,8 @@ function getDocumentSettings(textDocument: TextDocument): Thenable<LanguageSetti
if (scopedSettingsSupport) {
let promise = documentSettings[textDocument.uri];
if (!promise) {
let configRequestParam = { scopeUris: [textDocument.uri], sections: [textDocument.languageId] };
promise = connection.sendRequest(GetConfigurationRequest.type, configRequestParam).then(s => s[0][0]);
let configRequestParam = { items: [{ scopeUri: textDocument.uri, section: textDocument.languageId }] };
promise = connection.sendRequest(GetConfigurationRequest.type, configRequestParam).then(s => s[0]);
documentSettings[textDocument.uri] = promise;
}
return promise;