aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
authorJeremy Kolb <[email protected]>2020-02-26 13:42:26 +0000
committerJeremy Kolb <[email protected]>2020-02-26 13:42:26 +0000
commit74125d012e339f1ab7b2be63845d9dc96dab7db1 (patch)
treeb85f494b7b653f2a181d3b71895ede8d6a5eba97 /editors/code
parent80f8e474a0c6a1cf477afc2141f9d6182f8b05a3 (diff)
Enable SemanticTokens on the client
This will crash the extension on stable and insiders without the "--enable-proposed-api matklad.rust-analyzer" command line switch.
Diffstat (limited to 'editors/code')
-rw-r--r--editors/code/package.json1
-rw-r--r--editors/code/src/client.ts3
2 files changed, 4 insertions, 0 deletions
diff --git a/editors/code/package.json b/editors/code/package.json
index dff535fcd..16466faff 100644
--- a/editors/code/package.json
+++ b/editors/code/package.json
@@ -18,6 +18,7 @@
18 "engines": { 18 "engines": {
19 "vscode": "^1.42.0" 19 "vscode": "^1.42.0"
20 }, 20 },
21 "enableProposedApi": true,
21 "scripts": { 22 "scripts": {
22 "vscode:prepublish": "tsc && rollup -c", 23 "vscode:prepublish": "tsc && rollup -c",
23 "package": "vsce package -o rust-analyzer.vsix", 24 "package": "vsce package -o rust-analyzer.vsix",
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index aaf2ef40e..f9dbe34c2 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -3,6 +3,7 @@ import * as vscode from 'vscode';
3 3
4import { Config } from './config'; 4import { Config } from './config';
5import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; 5import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
6import { SemanticTokensFeature } from 'vscode-languageclient/lib/semanticTokens.proposed';
6 7
7export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> { 8export 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
@@ -83,5 +84,7 @@ 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 res.registerFeature(new SemanticTokensFeature(res));
88
86 return res; 89 return res;
87} 90}