From b5272573300766d0c8417161c1a4f959abc9ff43 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Tue, 1 Sep 2020 12:53:07 -0400 Subject: Move to vscode-languageclient 7.0.0-next.9 Stabilizes call hierarchy and semantic tokens features. --- editors/code/package-lock.json | 30 +++++++++++++++--------------- editors/code/package.json | 2 +- editors/code/src/client.ts | 15 +++------------ editors/code/src/commands.ts | 8 ++++---- editors/code/src/ctx.ts | 2 +- editors/code/src/util.ts | 2 +- 6 files changed, 25 insertions(+), 34 deletions(-) (limited to 'editors') diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json index 0c74561f1..63ba4bdf1 100644 --- a/editors/code/package-lock.json +++ b/editors/code/package-lock.json @@ -2409,32 +2409,32 @@ } }, "vscode-jsonrpc": { - "version": "5.1.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-5.1.0-next.1.tgz", - "integrity": "sha512-mwLDojZkbmpizSJSmp690oa9FB9jig18SIDGZeBCvFc2/LYSRvMm/WwWtMBJuJ1MfFh7rZXfQige4Uje5Z9NzA==" + "version": "6.0.0-next.5", + "resolved": "https://registry.npmjs.org/vscode-jsonrpc/-/vscode-jsonrpc-6.0.0-next.5.tgz", + "integrity": "sha512-IAgsltQPwg/pXOPsdXgbUTCaO9VSKZwirZN5SGtkdYQ/R3VjeC4v00WTVvoNayWMZpoC3O9u0ogqmsKzKhVasQ==" }, "vscode-languageclient": { - "version": "7.0.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.1.tgz", - "integrity": "sha512-JrjCUhLpQZxQ5VpWpilOHDMhVsn0fdN5jBh1uFNhSr5c2loJvRdr9Km2EuSQOFfOQsBKx0+xvY8PbsypNEcJ6w==", + "version": "7.0.0-next.9", + "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.0.0-next.9.tgz", + "integrity": "sha512-lFO+rN/i72CM2va6iKXq1lD7pJg8J93KEXf0w0boWVqU+DJhWzLrV3pXl8Xk1nCv//qOAyhlc/nx2KZCTeRF/A==", "requires": { "semver": "^6.3.0", - "vscode-languageserver-protocol": "3.16.0-next.2" + "vscode-languageserver-protocol": "3.16.0-next.7" } }, "vscode-languageserver-protocol": { - "version": "3.16.0-next.2", - "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.2.tgz", - "integrity": "sha512-atmkGT/W6tF0cx4SaWFYtFs2UeSeC28RPiap9myv2YZTaTCFvTBEPNWrU5QRKfkyM0tbgtGo6T3UCQ8tkDpjzA==", + "version": "3.16.0-next.7", + "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.16.0-next.7.tgz", + "integrity": "sha512-tOjrg+K3RddJ547zpC9/LAgTbzadkPuHlqJFFWIcKjVhiJOh73XyY+Ngcu9wukGaTsuSGjJ0W8rlmwanixa0FQ==", "requires": { - "vscode-jsonrpc": "5.1.0-next.1", - "vscode-languageserver-types": "3.16.0-next.1" + "vscode-jsonrpc": "6.0.0-next.5", + "vscode-languageserver-types": "3.16.0-next.3" } }, "vscode-languageserver-types": { - "version": "3.16.0-next.1", - "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.1.tgz", - "integrity": "sha512-tZFUSbyjUcrh+qQf13ALX4QDdOfDX0cVaBFgy7ktJ0VwS7AW/yRKgGPSxVqqP9OCMNPdqP57O5q47w2pEwfaUg==" + "version": "3.16.0-next.3", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.16.0-next.3.tgz", + "integrity": "sha512-s/z5ZqSe7VpoXJ6JQcvwRiPPA3nG0nAcJ/HH03zoU6QaFfnkcgPK+HshC3WKPPnC2G08xA0iRB6h7kmyBB5Adg==" }, "vscode-test": { "version": "1.4.0", diff --git a/editors/code/package.json b/editors/code/package.json index 7828407ad..6fc4464df 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -36,7 +36,7 @@ }, "dependencies": { "node-fetch": "^2.6.0", - "vscode-languageclient": "7.0.0-next.1" + "vscode-languageclient": "7.0.0-next.9" }, "devDependencies": { "@rollup/plugin-commonjs": "^13.0.2", diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index f5db55b8c..1ba2352ee 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -1,10 +1,7 @@ -import * as lc from 'vscode-languageclient'; +import * as lc from 'vscode-languageclient/node'; import * as vscode from 'vscode'; import * as ra from '../src/lsp_ext'; -import * as Is from 'vscode-languageclient/lib/utils/is'; - -import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; -import { SemanticTokensFeature } from 'vscode-languageclient/lib/semanticTokens.proposed'; +import * as Is from 'vscode-languageclient/lib/common/utils/is'; import { assert } from './util'; function renderCommand(cmd: ra.CommandLink) { @@ -57,7 +54,7 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient return hover; }, (error) => { - client.logFailedRequest(lc.HoverRequest.type, error); + client.handleFailedRequest(lc.HoverRequest.type, error, null); return Promise.resolve(null); }); }, @@ -140,12 +137,6 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient ); // To turn on all proposed features use: client.registerProposedFeatures(); - // Here we want to enable CallHierarchyFeature and SemanticTokensFeature - // since they are available on stable. - // Note that while these features are stable in vscode their LSP protocol - // implementations are still in the "proposed" category for 3.16. - client.registerFeature(new CallHierarchyFeature(client)); - client.registerFeature(new SemanticTokensFeature(client)); client.registerFeature(new ExperimentalFeatures()); return client; diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts index d0faf4745..69f2836ad 100644 --- a/editors/code/src/commands.ts +++ b/editors/code/src/commands.ts @@ -63,7 +63,7 @@ export function memoryUsage(ctx: Ctx): Cmd { provideTextDocumentContent(_uri: vscode.Uri): vscode.ProviderResult { if (!vscode.window.activeTextEditor) return ''; - return ctx.client.sendRequest(ra.memoryUsage, null).then((mem) => { + return ctx.client.sendRequest(ra.memoryUsage, null).then((mem: any) => { return 'Per-query memory usage:\n' + mem + '\n(note: database has been cleared)'; }); } @@ -121,7 +121,7 @@ export function joinLines(ctx: Ctx): Cmd { textDocument: { uri: editor.document.uri.toString() }, }); editor.edit((builder) => { - client.protocol2CodeConverter.asTextEdits(items).forEach((edit) => { + client.protocol2CodeConverter.asTextEdits(items).forEach((edit: any) => { builder.replace(edit.range, edit.newText); }); }); @@ -140,8 +140,8 @@ export function onEnter(ctx: Ctx): Cmd { position: client.code2ProtocolConverter.asPosition( editor.selection.active, ), - }).catch(_error => { - // client.logFailedRequest(OnEnterRequest.type, error); + }).catch((_error: any) => { + // client.handleFailedRequest(OnEnterRequest.type, error, null); return null; }); if (!lcEdits) return false; diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index 543f7e02e..d39864d33 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -1,5 +1,5 @@ import * as vscode from 'vscode'; -import * as lc from 'vscode-languageclient'; +import * as lc from 'vscode-languageclient/node'; import * as ra from './lsp_ext'; import { Config } from './config'; diff --git a/editors/code/src/util.ts b/editors/code/src/util.ts index ec2087502..08159b43c 100644 --- a/editors/code/src/util.ts +++ b/editors/code/src/util.ts @@ -1,4 +1,4 @@ -import * as lc from "vscode-languageclient"; +import * as lc from "vscode-languageclient/node"; import * as vscode from "vscode"; import { strict as nativeAssert } from "assert"; import { spawnSync } from "child_process"; -- cgit v1.2.3