Merge pull request #3321 from kjeremy/semantic-client

Enable SemanticTokens on the client
This commit is contained in:
Aleksey Kladov 2020-02-26 15:59:30 +01:00 committed by GitHub
commit 8c0d0894b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View 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",

View 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;
}