mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 05:19:39 +00:00
[css] update language server & client
This commit is contained in:
parent
a3607bc2d2
commit
1ba52e2113
|
@ -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
|
||||
|
|
4
extensions/css/npm-shrinkwrap.json
generated
4
extensions/css/npm-shrinkwrap.json
generated
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
4
extensions/css/server/npm-shrinkwrap.json
generated
4
extensions/css/server/npm-shrinkwrap.json
generated
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue