diff --git a/editors/code/package.json b/editors/code/package.json index dff535fcd1f..16466faff75 100644 --- a/editors/code/package.json +++ b/editors/code/package.json @@ -18,6 +18,7 @@ "engines": { "vscode": "^1.42.0" }, + "enableProposedApi": true, "scripts": { "vscode:prepublish": "tsc && rollup -c", "package": "vsce package -o rust-analyzer.vsix", diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index aaf2ef40e3e..f9dbe34c24b 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -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 { // '.' 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; }