From 74125d012e339f1ab7b2be63845d9dc96dab7db1 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Wed, 26 Feb 2020 08:42:26 -0500 Subject: 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. --- editors/code/package.json | 1 + editors/code/src/client.ts | 3 +++ 2 files changed, 4 insertions(+) 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 @@ "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 aaf2ef40e..f9dbe34c2 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; } -- cgit v1.2.3