aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/src/client.ts19
1 files changed, 15 insertions, 4 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index cffdcf11a..2067738ea 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -35,7 +35,7 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient
35 } as any 35 } as any
36 }; 36 };
37 37
38 const res = new lc.LanguageClient( 38 const client = new lc.LanguageClient(
39 'rust-analyzer', 39 'rust-analyzer',
40 'Rust Analyzer Language Server', 40 'Rust Analyzer Language Server',
41 serverOptions, 41 serverOptions,
@@ -47,8 +47,19 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient
47 // since they are available on stable. 47 // since they are available on stable.
48 // Note that while these features are stable in vscode their LSP protocol 48 // Note that while these features are stable in vscode their LSP protocol
49 // implementations are still in the "proposed" category for 3.16. 49 // implementations are still in the "proposed" category for 3.16.
50 res.registerFeature(new CallHierarchyFeature(res)); 50 client.registerFeature(new CallHierarchyFeature(client));
51 res.registerFeature(new SemanticTokensFeature(res)); 51 client.registerFeature(new SemanticTokensFeature(client));
52 client.registerFeature(new SnippetTextEditFeature());
52 53
53 return res; 54 return client;
55}
56
57class SnippetTextEditFeature implements lc.StaticFeature {
58 fillClientCapabilities(capabilities: lc.ClientCapabilities): void {
59 const caps: any = capabilities.experimental ?? {};
60 caps.snippetTextEdit = true;
61 capabilities.experimental = caps
62 }
63 initialize(_capabilities: lc.ServerCapabilities<any>, _documentSelector: lc.DocumentSelector | undefined): void {
64 }
54} 65}