mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Fix flickering with new syntax highlighting
This commit is contained in:
parent
7f7d96cffe
commit
b49508ffe3
1 changed files with 9 additions and 1 deletions
|
@ -3,7 +3,7 @@ import * as vscode from 'vscode';
|
||||||
|
|
||||||
import { Config } from './config';
|
import { Config } from './config';
|
||||||
import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
|
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> {
|
export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> {
|
||||||
// '.' Is the fallback if no folder is open
|
// '.' Is the fallback if no folder is open
|
||||||
|
@ -42,6 +42,14 @@ export async function createClient(config: Config, serverPath: string): Promise<
|
||||||
rustfmtArgs: config.rustfmtArgs,
|
rustfmtArgs: config.rustfmtArgs,
|
||||||
},
|
},
|
||||||
traceOutputChannel,
|
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(
|
const res = new lc.LanguageClient(
|
||||||
|
|
Loading…
Reference in a new issue