Skip to content

Commit 2920e7b

Browse files
bors[bot]kjeremy
andauthored
Merge #7701
7701: Remove semantic tokens workaround r=SomeoneToIgnore a=kjeremy Let's try this again. Co-authored-by: kjeremy <[email protected]>
2 parents b3c848e + a403be6 commit 2920e7b

File tree

2 files changed

+14
-31
lines changed

2 files changed

+14
-31
lines changed

editors/code/package-lock.json

Lines changed: 14 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

editors/code/src/client.ts

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import * as lc from 'vscode-languageclient/node';
22
import * as vscode from 'vscode';
33
import * as ra from '../src/lsp_ext';
44
import * as Is from 'vscode-languageclient/lib/common/utils/is';
5-
import { DocumentSemanticsTokensSignature, DocumentSemanticsTokensEditsSignature, DocumentRangeSemanticTokensSignature } from 'vscode-languageclient/lib/common/semanticTokens';
65
import { assert } from './util';
76
import { WorkspaceEdit } from 'vscode';
87

@@ -24,13 +23,6 @@ function renderHoverActions(actions: ra.CommandLinkGroup[]): vscode.MarkdownStri
2423
return result;
2524
}
2625

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-
3426
export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc.LanguageClient {
3527
// '.' Is the fallback if no folder is open
3628
// TODO?: Workspace folders support Uri's (eg: file://test.txt).
@@ -57,15 +49,6 @@ export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc
5749
diagnosticCollectionName: "rustc",
5850
traceOutputChannel,
5951
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-
},
6952
async provideHover(document: vscode.TextDocument, position: vscode.Position, token: vscode.CancellationToken, _next: lc.ProvideHoverSignature) {
7053
return client.sendRequest(lc.HoverRequest.type, client.code2ProtocolConverter.asTextDocumentPositionParams(document, position), token).then(
7154
(result) => {

0 commit comments

Comments
 (0)