diff options
Diffstat (limited to 'editors/code/src/client.ts')
-rw-r--r-- | editors/code/src/client.ts | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index aaf2ef40e..44bd04c21 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -3,6 +3,7 @@ import * as vscode from 'vscode'; | |||
3 | 3 | ||
4 | import { Config } from './config'; | 4 | import { Config } from './config'; |
5 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; | 5 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; |
6 | import { SemanticTokensFeature } from 'vscode-languageclient/lib/semanticTokens.proposed'; | ||
6 | 7 | ||
7 | export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> { | 8 | export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> { |
8 | // '.' Is the fallback if no folder is open | 9 | // '.' Is the fallback if no folder is open |
@@ -26,7 +27,7 @@ export async function createClient(config: Config, serverPath: string): Promise< | |||
26 | const clientOptions: lc.LanguageClientOptions = { | 27 | const clientOptions: lc.LanguageClientOptions = { |
27 | documentSelector: [{ scheme: 'file', language: 'rust' }], | 28 | documentSelector: [{ scheme: 'file', language: 'rust' }], |
28 | initializationOptions: { | 29 | initializationOptions: { |
29 | publishDecorations: true, | 30 | publishDecorations: !config.highlightingSemanticTokens, |
30 | lruCapacity: config.lruCapacity, | 31 | lruCapacity: config.lruCapacity, |
31 | maxInlayHintLength: config.maxInlayHintLength, | 32 | maxInlayHintLength: config.maxInlayHintLength, |
32 | cargoWatchEnable: cargoWatchOpts.enable, | 33 | cargoWatchEnable: cargoWatchOpts.enable, |
@@ -83,5 +84,10 @@ export async function createClient(config: Config, serverPath: string): Promise< | |||
83 | // 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. |
84 | // 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. |
85 | res.registerFeature(new CallHierarchyFeature(res)); | 86 | res.registerFeature(new CallHierarchyFeature(res)); |
87 | |||
88 | if (config.highlightingSemanticTokens) { | ||
89 | res.registerFeature(new SemanticTokensFeature(res)); | ||
90 | } | ||
91 | |||
86 | return res; | 92 | return res; |
87 | } | 93 | } |