about summary refs log tree commit diff
path: root/editors/code/src/client.ts
diff options
context:
space:
mode:
authorAleksey Kladov <aleksey.kladov@gmail.com>2020-02-26 16:03:30 +0100
committerAleksey Kladov <aleksey.kladov@gmail.com>2020-02-26 16:03:30 +0100
commit225ef6dea24a0e8766fdfd677fb98a15095fa7e5 (patch)
treee88856b7328e69823c41b4ef305f8ae277c9aba5 /editors/code/src/client.ts
parent8c0d0894b66ceb1800f09df246ba8fb73b9ceccb (diff)
downloadrust-225ef6dea24a0e8766fdfd677fb98a15095fa7e5.tar.gz
rust-225ef6dea24a0e8766fdfd677fb98a15095fa7e5.zip
Config to switch to semantic tokens
Diffstat (limited to 'editors/code/src/client.ts')
-rw-r--r--editors/code/src/client.ts7
1 files changed, 5 insertions, 2 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index f9dbe34c24b..44bd04c21b7 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -27,7 +27,7 @@ export async function createClient(config: Config, serverPath: string): Promise<
     const clientOptions: lc.LanguageClientOptions = {
         documentSelector: [{ scheme: 'file', language: 'rust' }],
         initializationOptions: {
-            publishDecorations: true,
+            publishDecorations: !config.highlightingSemanticTokens,
             lruCapacity: config.lruCapacity,
             maxInlayHintLength: config.maxInlayHintLength,
             cargoWatchEnable: cargoWatchOpts.enable,
@@ -84,7 +84,10 @@ export async function createClient(config: Config, serverPath: string): Promise<
     // Here we want to just enable CallHierarchyFeature since it is available on stable.
     // Note that while the CallHierarchyFeature is stable the LSP protocol is not.
     res.registerFeature(new CallHierarchyFeature(res));
-    res.registerFeature(new SemanticTokensFeature(res));
+
+    if (config.highlightingSemanticTokens) {
+        res.registerFeature(new SemanticTokensFeature(res));
+    }
 
     return res;
 }