diff options
| author | kjeremy <kjeremy@gmail.com> | 2021-02-16 16:27:30 -0500 |
|---|---|---|
| committer | kjeremy <kjeremy@gmail.com> | 2021-02-16 16:27:30 -0500 |
| commit | a403be6456a0f579e5536e19aa230a425e7ea71b (patch) | |
| tree | b7a24119c7eee3b39579ee62494f516e136df6e2 /editors/code/src/client.ts | |
| parent | 13008c4d30968155fdac3a1bd383045f3dd89dc0 (diff) | |
| download | rust-a403be6456a0f579e5536e19aa230a425e7ea71b.tar.gz rust-a403be6456a0f579e5536e19aa230a425e7ea71b.zip | |
Remove Semantic Tokens flicker workaround
https://github.com/microsoft/vscode-languageserver-node/issues/576 has been closed with the latest vscode-languageclient release.
Diffstat (limited to 'editors/code/src/client.ts')
| -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 db5f4c023de..0771ca3b69a 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -2,7 +2,6 @@ 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/common/utils/is'; -import { DocumentSemanticsTokensSignature, DocumentSemanticsTokensEditsSignature, DocumentRangeSemanticTokensSignature } from 'vscode-languageclient/lib/common/semanticTokens'; import { assert } from './util'; import { WorkspaceEdit } from 'vscode'; @@ -24,13 +23,6 @@ function renderHoverActions(actions: ra.CommandLinkGroup[]): vscode.MarkdownStri return result; } -// Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576 -async function semanticHighlightingWorkaround<R, F extends (...args: any[]) => vscode.ProviderResult<R>>(next: F, ...args: Parameters<F>): Promise<R> { - const res = await next(...args); - if (res == null) throw new Error('busy'); - return res; -} - export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc.LanguageClient { // '.' Is the fallback if no folder is open // TODO?: Workspace folders support Uri's (eg: file://test.txt). @@ -57,15 +49,6 @@ export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc diagnosticCollectionName: "rustc", traceOutputChannel, middleware: { - provideDocumentSemanticTokens(document: vscode.TextDocument, token: vscode.CancellationToken, next: DocumentSemanticsTokensSignature): vscode.ProviderResult<vscode.SemanticTokens> { - return semanticHighlightingWorkaround(next, document, token); - }, - provideDocumentSemanticTokensEdits(document: vscode.TextDocument, previousResultId: string, token: vscode.CancellationToken, next: DocumentSemanticsTokensEditsSignature): vscode.ProviderResult<vscode.SemanticTokensEdits | vscode.SemanticTokens> { - return semanticHighlightingWorkaround(next, document, previousResultId, token); - }, - provideDocumentRangeSemanticTokens(document: vscode.TextDocument, range: vscode.Range, token: vscode.CancellationToken, next: DocumentRangeSemanticTokensSignature): vscode.ProviderResult<vscode.SemanticTokens> { - return semanticHighlightingWorkaround(next, document, range, token); - }, async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, _next: lc.ProvideHoverSignature) { return client.sendRequest(lc.HoverRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then( (result) => { |
