aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
Diffstat (limited to 'editors')
-rw-r--r--editors/code/package-lock.json28
-rw-r--r--editors/code/src/client.ts17
2 files changed, 14 insertions, 31 deletions
diff --git a/editors/code/package-lock.json b/editors/code/package-lock.json
index 4fbfaf90f..af3035db9 100644
--- a/editors/code/package-lock.json
+++ b/editors/code/package-lock.json
@@ -2931,22 +2931,22 @@
2931 } 2931 }
2932 }, 2932 },
2933 "node_modules/vscode-languageclient": { 2933 "node_modules/vscode-languageclient": {
2934 "version": "7.1.0-next.1", 2934 "version": "7.1.0-next.2",
2935 "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.1.0-next.1.tgz", 2935 "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.1.0-next.2.tgz",
2936 "integrity": "sha512-pMdMyJ5e3CfdyvtDsj6ytTO+WcmrvtrFJWvBk4rZnIKmA3aCjrqTYI0XSWN/Cf4kcaV1J2+fTZf/2RcP2SzDiQ==", 2936 "integrity": "sha512-LhSxbPcUDzlBRCp5vRo4ZRk75CrfXZ2FF1soXIlbHp9TeGQI1M3YD8ECAe0VvfYD/STemMzJrj4cHA2oWiOg0w==",
2937 "dependencies": { 2937 "dependencies": {
2938 "minimatch": "^3.0.4", 2938 "minimatch": "^3.0.4",
2939 "semver": "^7.3.4", 2939 "semver": "^7.3.4",
2940 "vscode-languageserver-protocol": "3.17.0-next.1" 2940 "vscode-languageserver-protocol": "3.17.0-next.3"
2941 }, 2941 },
2942 "engines": { 2942 "engines": {
2943 "vscode": "^1.53.0" 2943 "vscode": "^1.53.0"
2944 } 2944 }
2945 }, 2945 },
2946 "node_modules/vscode-languageserver-protocol": { 2946 "node_modules/vscode-languageserver-protocol": {
2947 "version": "3.17.0-next.1", 2947 "version": "3.17.0-next.3",
2948 "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.0-next.1.tgz", 2948 "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.0-next.3.tgz",
2949 "integrity": "sha512-cbFKGk+Q7HQ5RDdf6qiQrRv9qxR/87hBm/GrfLcQ5rmHPJOXg//ZYCXEQF+wSJNmcc6IrnET2cHJUxlZYHUEXA==", 2949 "integrity": "sha512-II+BN3BqsGXyasN8BDgLFlELxkRLLWkafFzRZMEfMTqJ6oNMINTbMDZgZ6YpbMLHwfoq+h3Q04zLOZqF4YW6bg==",
2950 "dependencies": { 2950 "dependencies": {
2951 "vscode-jsonrpc": "6.1.0-next.1", 2951 "vscode-jsonrpc": "6.1.0-next.1",
2952 "vscode-languageserver-types": "3.17.0-next.1" 2952 "vscode-languageserver-types": "3.17.0-next.1"
@@ -5629,19 +5629,19 @@
5629 "integrity": "sha512-2s1qEg8N97p8pooHnA8xgR4vnslCTJuE3rQqSQeJuSDklFcQSn9yW8gOinH/1vKeWiPuzHTG9FFty91v4v9Pag==" 5629 "integrity": "sha512-2s1qEg8N97p8pooHnA8xgR4vnslCTJuE3rQqSQeJuSDklFcQSn9yW8gOinH/1vKeWiPuzHTG9FFty91v4v9Pag=="
5630 }, 5630 },
5631 "vscode-languageclient": { 5631 "vscode-languageclient": {
5632 "version": "7.1.0-next.1", 5632 "version": "7.1.0-next.2",
5633 "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.1.0-next.1.tgz", 5633 "resolved": "https://registry.npmjs.org/vscode-languageclient/-/vscode-languageclient-7.1.0-next.2.tgz",
5634 "integrity": "sha512-pMdMyJ5e3CfdyvtDsj6ytTO+WcmrvtrFJWvBk4rZnIKmA3aCjrqTYI0XSWN/Cf4kcaV1J2+fTZf/2RcP2SzDiQ==", 5634 "integrity": "sha512-LhSxbPcUDzlBRCp5vRo4ZRk75CrfXZ2FF1soXIlbHp9TeGQI1M3YD8ECAe0VvfYD/STemMzJrj4cHA2oWiOg0w==",
5635 "requires": { 5635 "requires": {
5636 "minimatch": "^3.0.4", 5636 "minimatch": "^3.0.4",
5637 "semver": "^7.3.4", 5637 "semver": "^7.3.4",
5638 "vscode-languageserver-protocol": "3.17.0-next.1" 5638 "vscode-languageserver-protocol": "3.17.0-next.3"
5639 } 5639 }
5640 }, 5640 },
5641 "vscode-languageserver-protocol": { 5641 "vscode-languageserver-protocol": {
5642 "version": "3.17.0-next.1", 5642 "version": "3.17.0-next.3",
5643 "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.0-next.1.tgz", 5643 "resolved": "https://registry.npmjs.org/vscode-languageserver-protocol/-/vscode-languageserver-protocol-3.17.0-next.3.tgz",
5644 "integrity": "sha512-cbFKGk+Q7HQ5RDdf6qiQrRv9qxR/87hBm/GrfLcQ5rmHPJOXg//ZYCXEQF+wSJNmcc6IrnET2cHJUxlZYHUEXA==", 5644 "integrity": "sha512-II+BN3BqsGXyasN8BDgLFlELxkRLLWkafFzRZMEfMTqJ6oNMINTbMDZgZ6YpbMLHwfoq+h3Q04zLOZqF4YW6bg==",
5645 "requires": { 5645 "requires": {
5646 "vscode-jsonrpc": "6.1.0-next.1", 5646 "vscode-jsonrpc": "6.1.0-next.1",
5647 "vscode-languageserver-types": "3.17.0-next.1" 5647 "vscode-languageserver-types": "3.17.0-next.1"
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index db5f4c023..0771ca3b6 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -2,7 +2,6 @@ import * as lc from 'vscode-languageclient/node';
2import * as vscode from 'vscode'; 2import * as vscode from 'vscode';
3import * as ra from '../src/lsp_ext'; 3import * as ra from '../src/lsp_ext';
4import * as Is from 'vscode-languageclient/lib/common/utils/is'; 4import * as Is from 'vscode-languageclient/lib/common/utils/is';
5import { DocumentSemanticsTokensSignature, DocumentSemanticsTokensEditsSignature, DocumentRangeSemanticTokensSignature } from 'vscode-languageclient/lib/common/semanticTokens';
6import { assert } from './util'; 5import { assert } from './util';
7import { WorkspaceEdit } from 'vscode'; 6import { WorkspaceEdit } from 'vscode';
8 7
@@ -24,13 +23,6 @@ function renderHoverActions(actions: ra.CommandLinkGroup[]): vscode.MarkdownStri
24 return result; 23 return result;
25} 24}
26 25
27// Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576
28async function semanticHighlightingWorkaround<R, F extends (...args: any[]) => vscode.ProviderResult<R>>(next: F, ...args: Parameters<F>): Promise<R> {
29 const res = await next(...args);
30 if (res == null) throw new Error('busy');
31 return res;
32}
33
34export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc.LanguageClient { 26export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc.LanguageClient {
35 // '.' Is the fallback if no folder is open 27 // '.' Is the fallback if no folder is open
36 // TODO?: Workspace folders support Uri's (eg: file://test.txt). 28 // TODO?: Workspace folders support Uri's (eg: file://test.txt).
@@ -57,15 +49,6 @@ export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc
57 diagnosticCollectionName: "rustc", 49 diagnosticCollectionName: "rustc",
58 traceOutputChannel, 50 traceOutputChannel,
59 middleware: { 51 middleware: {
60 provideDocumentSemanticTokens(document: vscode.TextDocument, token: vscode.CancellationToken, next: DocumentSemanticsTokensSignature): vscode.ProviderResult<vscode.SemanticTokens> {
61 return semanticHighlightingWorkaround(next, document, token);
62 },
63 provideDocumentSemanticTokensEdits(document: vscode.TextDocument, previousResultId: string, token: vscode.CancellationToken, next: DocumentSemanticsTokensEditsSignature): vscode.ProviderResult<vscode.SemanticTokensEdits | vscode.SemanticTokens> {
64 return semanticHighlightingWorkaround(next, document, previousResultId, token);
65 },
66 provideDocumentRangeSemanticTokens(document: vscode.TextDocument, range: vscode.Range, token: vscode.CancellationToken, next: DocumentRangeSemanticTokensSignature): vscode.ProviderResult<vscode.SemanticTokens> {
67 return semanticHighlightingWorkaround(next, document, range, token);
68 },
69 async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, _next: lc.ProvideHoverSignature) { 52 async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, _next: lc.ProvideHoverSignature) {
70 return client.sendRequest(lc.HoverRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then( 53 return client.sendRequest(lc.HoverRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then(
71 (result) => { 54 (result) => {