3339: Fix flickering with new syntax highlighting r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
This commit is contained in:
bors[bot] 2020-02-27 09:25:34 +00:00 committed by GitHub
commit ebeca1990e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,7 +3,7 @@ import * as vscode from 'vscode';
import { Config } from './config';
import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
import { SemanticTokensFeature } from 'vscode-languageclient/lib/semanticTokens.proposed';
import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed';
export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> {
// '.' Is the fallback if no folder is open
@ -42,6 +42,14 @@ export async function createClient(config: Config, serverPath: string): Promise<
rustfmtArgs: config.rustfmtArgs,
},
traceOutputChannel,
middleware: {
// Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576
async provideDocumentSemanticTokens(document: vscode.TextDocument, token: vscode.CancellationToken, next: DocumentSemanticsTokensSignature) {
let res = await next(document, token);
if (res === undefined) throw new Error('busy');
return res;
}
} as any
};
const res = new lc.LanguageClient(