mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-27 05:23:24 +00:00
Merge #3137
3137: Do not register all proposed features r=matklad a=kjeremy Instead only opt-in to CallHierarchy since it has a vscode API but LSP support is still proposed. Discovered while working on SemanticTokens which does not have a vscode API and is still in the proposed state. Somehow enabling it would crash the language server. See https://github.com/microsoft/vscode-languageserver-node/issues/572 Co-authored-by: kjeremy <kjeremy@gmail.com>
This commit is contained in:
commit
7c1fb6caa5
1 changed files with 6 additions and 1 deletions
|
@ -3,6 +3,7 @@ import * as lc from 'vscode-languageclient';
|
||||||
import { window, workspace } from 'vscode';
|
import { window, workspace } from 'vscode';
|
||||||
import { Config } from './config';
|
import { Config } from './config';
|
||||||
import { ensureLanguageServerBinary } from './installation/language_server';
|
import { ensureLanguageServerBinary } from './installation/language_server';
|
||||||
|
import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed';
|
||||||
|
|
||||||
export async function createClient(config: Config): Promise<null | lc.LanguageClient> {
|
export async function createClient(config: Config): Promise<null | lc.LanguageClient> {
|
||||||
// '.' Is the fallback if no folder is open
|
// '.' Is the fallback if no folder is open
|
||||||
|
@ -78,6 +79,10 @@ export async function createClient(config: Config): Promise<null | lc.LanguageCl
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
res.registerProposedFeatures();
|
|
||||||
|
// To turn on all proposed features use: res.registerProposedFeatures();
|
||||||
|
// 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));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue