Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit 0028e73

Browse files
committed
fix: Force disable augmentsSyntaxTokens capability on VSCode
1 parent 2f8cd66 commit 0028e73

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

editors/code/src/client.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ export async function createClient(
366366

367367
// To turn on all proposed features use: client.registerProposedFeatures();
368368
client.registerFeature(new ExperimentalFeatures());
369+
client.registerFeature(new OverrideFeatures());
369370

370371
return client;
371372
}
@@ -401,6 +402,25 @@ class ExperimentalFeatures implements lc.StaticFeature {
401402
dispose(): void {}
402403
}
403404

405+
class OverrideFeatures implements lc.StaticFeature {
406+
getState(): lc.FeatureState {
407+
return { kind: "static" };
408+
}
409+
fillClientCapabilities(capabilities: lc.ClientCapabilities): void {
410+
// Force disable `augmentsSyntaxTokens`, VSCode's textmate grammar is somewhat incomplete
411+
// making the experience generally worse
412+
const caps = capabilities.textDocument?.semanticTokens;
413+
if (caps) {
414+
caps.augmentsSyntaxTokens = false;
415+
}
416+
}
417+
initialize(
418+
_capabilities: lc.ServerCapabilities,
419+
_documentSelector: lc.DocumentSelector | undefined
420+
): void {}
421+
dispose(): void {}
422+
}
423+
404424
function isCodeActionWithoutEditsAndCommands(value: any): boolean {
405425
const candidate: lc.CodeAction = value;
406426
return (

0 commit comments

Comments
 (0)