]> git.lizzy.rs Git - rust.git/commitdiff
Enable SemanticTokens on the client
authorJeremy Kolb <kjeremy@gmail.com>
Wed, 26 Feb 2020 13:42:26 +0000 (08:42 -0500)
committerJeremy Kolb <kjeremy@gmail.com>
Wed, 26 Feb 2020 13:42:26 +0000 (08:42 -0500)
This will crash the extension on stable and insiders without the "--enable-proposed-api matklad.rust-analyzer" command line switch.

editors/code/package.json
editors/code/src/client.ts

index dff535fcd1f599ac6651624468980fe3be4f5d3d..16466faff75cdb9506c816790ad0b6ddd3cc63f9 100644 (file)
@@ -18,6 +18,7 @@
     "engines": {
         "vscode": "^1.42.0"
     },
+    "enableProposedApi": true,
     "scripts": {
         "vscode:prepublish": "tsc && rollup -c",
         "package": "vsce package -o rust-analyzer.vsix",
index aaf2ef40e3e3f1ead29f524f2c8de33f729aa027..f9dbe34c24bae8d85b369302ac29453b46fc349b 100644 (file)
@@ -3,6 +3,7 @@ import * as vscode from 'vscode';
 
 import { Config } from './config';
 import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
+import { SemanticTokensFeature } from 'vscode-languageclient/lib/semanticTokens.proposed';
 
 export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> {
     // '.' Is the fallback if no folder is open
@@ -83,5 +84,7 @@ export async function createClient(config: Config, serverPath: string): Promise<
     // Here we want to just enable CallHierarchyFeature since it is available on stable.
     // Note that while the CallHierarchyFeature is stable the LSP protocol is not.
     res.registerFeature(new CallHierarchyFeature(res));
+    res.registerFeature(new SemanticTokensFeature(res));
+
     return res;
 }