diff options
author | Aleksey Kladov <[email protected]> | 2020-02-26 15:03:30 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-02-26 15:03:30 +0000 |
commit | 225ef6dea24a0e8766fdfd677fb98a15095fa7e5 (patch) | |
tree | e88856b7328e69823c41b4ef305f8ae277c9aba5 /editors/code/src/client.ts | |
parent | 8c0d0894b66ceb1800f09df246ba8fb73b9ceccb (diff) |
Config to switch to semantic tokens
Diffstat (limited to 'editors/code/src/client.ts')
-rw-r--r-- | editors/code/src/client.ts | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index f9dbe34c2..44bd04c21 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< | |||
27 | const clientOptions: lc.LanguageClientOptions = { | 27 | const clientOptions: lc.LanguageClientOptions = { |
28 | documentSelector: [{ scheme: 'file', language: 'rust' }], | 28 | documentSelector: [{ scheme: 'file', language: 'rust' }], |
29 | initializationOptions: { | 29 | initializationOptions: { |
30 | publishDecorations: true, | 30 | publishDecorations: !config.highlightingSemanticTokens, |
31 | lruCapacity: config.lruCapacity, | 31 | lruCapacity: config.lruCapacity, |
32 | maxInlayHintLength: config.maxInlayHintLength, | 32 | maxInlayHintLength: config.maxInlayHintLength, |
33 | cargoWatchEnable: cargoWatchOpts.enable, | 33 | cargoWatchEnable: cargoWatchOpts.enable, |
@@ -84,7 +84,10 @@ export async function createClient(config: Config, serverPath: string): Promise< | |||
84 | // Here we want to just enable CallHierarchyFeature since it is available on stable. | 84 | // Here we want to just enable CallHierarchyFeature since it is available on stable. |
85 | // Note that while the CallHierarchyFeature is stable the LSP protocol is not. | 85 | // Note that while the CallHierarchyFeature is stable the LSP protocol is not. |
86 | res.registerFeature(new CallHierarchyFeature(res)); | 86 | res.registerFeature(new CallHierarchyFeature(res)); |
87 | res.registerFeature(new SemanticTokensFeature(res)); | 87 | |
88 | if (config.highlightingSemanticTokens) { | ||
89 | res.registerFeature(new SemanticTokensFeature(res)); | ||
90 | } | ||
88 | 91 | ||
89 | return res; | 92 | return res; |
90 | } | 93 | } |