diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-04-08 21:39:45 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-04-08 21:39:45 +0100 |
commit | 937fd557b09eb3a762319200796a0114a377e9c4 (patch) | |
tree | 74828e0f7fcc984487137f0b3534100f34810455 /editors/code/src/client.ts | |
parent | 779555c1beac90f633c01a773558c4007c99c97f (diff) | |
parent | 6f0f86d2c57749000df2d6dc2932983173f948ee (diff) |
Merge #3899
3899: Enable the SemanticTokensFeature by default r=matklad a=kjeremy
This is covered under vscode's "editor.semanticHighlighting.enabled"
setting plus the user has to have a theme that has opted into highlighting.
Bumps required vscode stable to 1.44
Closes #3773
Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'editors/code/src/client.ts')
-rw-r--r-- | editors/code/src/client.ts | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 3b1d00bca..0ad4b63ae 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import * as lc from 'vscode-languageclient'; | 1 | import * as lc from 'vscode-languageclient'; |
2 | import * as vscode from 'vscode'; | 2 | import * as vscode from 'vscode'; |
3 | 3 | ||
4 | import { Config } from './config'; | ||
5 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; | 4 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; |
6 | import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed'; | 5 | import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed'; |
7 | 6 | ||
8 | export async function createClient(config: Config, serverPath: string, cwd: string): Promise<lc.LanguageClient> { | 7 | export async function createClient(serverPath: string, cwd: string): Promise<lc.LanguageClient> { |
9 | // '.' Is the fallback if no folder is open | 8 | // '.' Is the fallback if no folder is open |
10 | // TODO?: Workspace folders support Uri's (eg: file://test.txt). | 9 | // TODO?: Workspace folders support Uri's (eg: file://test.txt). |
11 | // It might be a good idea to test if the uri points to a file. | 10 | // It might be a good idea to test if the uri points to a file. |
@@ -73,15 +72,12 @@ export async function createClient(config: Config, serverPath: string, cwd: stri | |||
73 | }; | 72 | }; |
74 | 73 | ||
75 | // To turn on all proposed features use: res.registerProposedFeatures(); | 74 | // To turn on all proposed features use: res.registerProposedFeatures(); |
76 | // Here we want to just enable CallHierarchyFeature since it is available on stable. | 75 | // Here we want to enable CallHierarchyFeature and SemanticTokensFeature |
77 | // Note that while the CallHierarchyFeature is stable the LSP protocol is not. | 76 | // since they are available on stable. |
77 | // Note that while these features are stable in vscode their LSP protocol | ||
78 | // implementations are still in the "proposed" category for 3.16. | ||
78 | res.registerFeature(new CallHierarchyFeature(res)); | 79 | res.registerFeature(new CallHierarchyFeature(res)); |
79 | 80 | res.registerFeature(new SemanticTokensFeature(res)); | |
80 | if (config.package.enableProposedApi) { | ||
81 | if (config.highlightingSemanticTokens) { | ||
82 | res.registerFeature(new SemanticTokensFeature(res)); | ||
83 | } | ||
84 | } | ||
85 | 81 | ||
86 | return res; | 82 | return res; |
87 | } | 83 | } |