diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-27 09:25:34 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-27 09:25:34 +0000 |
commit | ebeca1990e6eaf3555ccb4074154b1518fe383fa (patch) | |
tree | 12919115e00f371f775485743f00890724e70217 /editors/code/src | |
parent | 04b3bd5ee854f04ca070770be1fc313dbe94ed75 (diff) | |
parent | b49508ffe3d34be0520c594bae69e906f22af513 (diff) |
Merge #3339
3339: Fix flickering with new syntax highlighting r=matklad a=matklad
bors r+
🤖
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'editors/code/src')
-rw-r--r-- | editors/code/src/client.ts | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 44bd04c21..1f90af898 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -3,7 +3,7 @@ import * as vscode from 'vscode'; | |||
3 | 3 | ||
4 | import { Config } from './config'; | 4 | import { Config } from './config'; |
5 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; | 5 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; |
6 | import { SemanticTokensFeature } from 'vscode-languageclient/lib/semanticTokens.proposed'; | 6 | import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed'; |
7 | 7 | ||
8 | export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> { | 8 | export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> { |
9 | // '.' Is the fallback if no folder is open | 9 | // '.' Is the fallback if no folder is open |
@@ -42,6 +42,14 @@ export async function createClient(config: Config, serverPath: string): Promise< | |||
42 | rustfmtArgs: config.rustfmtArgs, | 42 | rustfmtArgs: config.rustfmtArgs, |
43 | }, | 43 | }, |
44 | traceOutputChannel, | 44 | traceOutputChannel, |
45 | middleware: { | ||
46 | // Workaround for https://github.com/microsoft/vscode-languageserver-node/issues/576 | ||
47 | async provideDocumentSemanticTokens(document: vscode.TextDocument, token: vscode.CancellationToken, next: DocumentSemanticsTokensSignature) { | ||
48 | let res = await next(document, token); | ||
49 | if (res === undefined) throw new Error('busy'); | ||
50 | return res; | ||
51 | } | ||
52 | } as any | ||
45 | }; | 53 | }; |
46 | 54 | ||
47 | const res = new lc.LanguageClient( | 55 | const res = new lc.LanguageClient( |