fix: Force disable augmentsSyntaxTokens capability on VSCode
This commit is contained in:
parent
2f8cd66fb4
commit
0028e73927
@ -366,6 +366,7 @@ export async function createClient(
|
|||||||
|
|
||||||
// To turn on all proposed features use: client.registerProposedFeatures();
|
// To turn on all proposed features use: client.registerProposedFeatures();
|
||||||
client.registerFeature(new ExperimentalFeatures());
|
client.registerFeature(new ExperimentalFeatures());
|
||||||
|
client.registerFeature(new OverrideFeatures());
|
||||||
|
|
||||||
return client;
|
return client;
|
||||||
}
|
}
|
||||||
@ -401,6 +402,25 @@ class ExperimentalFeatures implements lc.StaticFeature {
|
|||||||
dispose(): void {}
|
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 {
|
function isCodeActionWithoutEditsAndCommands(value: any): boolean {
|
||||||
const candidate: lc.CodeAction = value;
|
const candidate: lc.CodeAction = value;
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user