@@ -2,7 +2,6 @@ import * as lc from 'vscode-languageclient/node';
2
2
import * as vscode from 'vscode' ;
3
3
import * as ra from '../src/lsp_ext' ;
4
4
import * as Is from 'vscode-languageclient/lib/common/utils/is' ;
5
- import { DocumentSemanticsTokensSignature , DocumentSemanticsTokensEditsSignature , DocumentRangeSemanticTokensSignature } from 'vscode-languageclient/lib/common/semanticTokens' ;
6
5
import { assert } from './util' ;
7
6
import { WorkspaceEdit } from 'vscode' ;
8
7
@@ -24,13 +23,6 @@ function renderHoverActions(actions: ra.CommandLinkGroup[]): vscode.MarkdownStri
24
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
26
export function createClient ( serverPath : string , cwd : string , extraEnv : Env ) : lc . LanguageClient {
35
27
// '.' Is the fallback if no folder is open
36
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
49
diagnosticCollectionName : "rustc" ,
58
50
traceOutputChannel,
59
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
52
async provideHover ( document : vscode . TextDocument , position : vscode . Position , token : vscode . CancellationToken , _next : lc . ProvideHoverSignature ) {
70
53
return client . sendRequest ( lc . HoverRequest . type , client . code2ProtocolConverter . asTextDocumentPositionParams ( document , position ) , token ) . then (
71
54
( result ) => {
0 commit comments