diff options
Diffstat (limited to 'editors')
-rw-r--r-- | editors/code/src/client.ts | 17 |
1 files changed, 0 insertions, 17 deletions
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'; | |||
2 | import * as vscode from 'vscode'; | 2 | import * as vscode from 'vscode'; |
3 | import * as ra from '../src/lsp_ext'; | 3 | import * as ra from '../src/lsp_ext'; |
4 | import * as Is from 'vscode-languageclient/lib/common/utils/is'; | 4 | import * as Is from 'vscode-languageclient/lib/common/utils/is'; |
5 | import { DocumentSemanticsTokensSignature, DocumentSemanticsTokensEditsSignature, DocumentRangeSemanticTokensSignature } from 'vscode-languageclient/lib/common/semanticTokens'; | ||
6 | import { assert } from './util'; | 5 | import { assert } from './util'; |
7 | import { WorkspaceEdit } from 'vscode'; | 6 | import { 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 | ||
28 | async 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 | |||
34 | export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc.LanguageClient { | 26 | export 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) => { |