From a403be6456a0f579e5536e19aa230a425e7ea71b Mon Sep 17 00:00:00 2001 From: kjeremy Date: Tue, 16 Feb 2021 16:27:30 -0500 Subject: Remove Semantic Tokens flicker workaround https://github.com/microsoft/vscode-languageserver-node/issues/576 has been closed with the latest vscode-languageclient release. --- editors/code/src/client.ts | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'editors/code') 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'; 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 vscode.ProviderResult>(next: F, ...args: Parameters): Promise { - 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 { - return semanticHighlightingWorkaround(next, document, token); - }, - provideDocumentSemanticTokensEdits(document: vscode.TextDocument, previousResultId: string, token: vscode.CancellationToken, next: DocumentSemanticsTokensEditsSignature): vscode.ProviderResult { - return semanticHighlightingWorkaround(next, document, previousResultId, token); - }, - provideDocumentRangeSemanticTokens(document: vscode.TextDocument, range: vscode.Range, token: vscode.CancellationToken, next: DocumentRangeSemanticTokensSignature): vscode.ProviderResult { - 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) => { -- cgit v1.2.3