diff options
| author | Lukas Wirth <lukastw97@gmail.com> | 2023-05-16 22:08:58 +0200 |
|---|---|---|
| committer | Lukas Wirth <lukastw97@gmail.com> | 2023-05-18 08:26:16 +0200 |
| commit | 0028e73927fc4e3402c7243511936de0f2bc17bc (patch) | |
| tree | 754a1031b87b330504e49ea39ee00b04199ab989 | |
| parent | 2f8cd66fb4c98026d2bdbdf17270e3472e1ca42a (diff) | |
| download | rust-0028e73927fc4e3402c7243511936de0f2bc17bc.tar.gz rust-0028e73927fc4e3402c7243511936de0f2bc17bc.zip | |
fix: Force disable augmentsSyntaxTokens capability on VSCode
| -rw-r--r-- | editors/code/src/client.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index b27d9f54943..f721fcce766 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -366,6 +366,7 @@ export async function createClient( // To turn on all proposed features use: client.registerProposedFeatures(); client.registerFeature(new ExperimentalFeatures()); + client.registerFeature(new OverrideFeatures()); return client; } @@ -401,6 +402,25 @@ class ExperimentalFeatures implements lc.StaticFeature { dispose(): void {} } +class OverrideFeatures implements lc.StaticFeature { + getState(): lc.FeatureState { + return { kind: "static" }; + } + fillClientCapabilities(capabilities: lc.ClientCapabilities): void { + // Force disable `augmentsSyntaxTokens`, VSCode's textmate grammar is somewhat incomplete + // making the experience generally worse + const caps = capabilities.textDocument?.semanticTokens; + if (caps) { + caps.augmentsSyntaxTokens = false; + } + } + initialize( + _capabilities: lc.ServerCapabilities, + _documentSelector: lc.DocumentSelector | undefined + ): void {} + dispose(): void {} +} + function isCodeActionWithoutEditsAndCommands(value: any): boolean { const candidate: lc.CodeAction = value; return ( |
