aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/client.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/client.ts')
-rw-r--r--editors/code/src/client.ts16
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 @@
1import * as lc from 'vscode-languageclient'; 1import * as lc from 'vscode-languageclient';
2import * as vscode from 'vscode'; 2import * as vscode from 'vscode';
3 3
4import { Config } from './config';
5import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; 4import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
6import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed'; 5import { SemanticTokensFeature, DocumentSemanticsTokensSignature } from 'vscode-languageclient/lib/semanticTokens.proposed';
7 6
8export async function createClient(config: Config, serverPath: string, cwd: string): Promise<lc.LanguageClient> { 7export 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}