fix: Add config and capability for test explorer

This commit is contained in:
Lukas Wirth 2024-03-06 19:10:50 +01:00
parent 52d8ae791d
commit 1c6d1b4f2a
7 changed files with 41 additions and 12 deletions

View file

@ -372,13 +372,18 @@ export async function createClient(
);
// To turn on all proposed features use: client.registerProposedFeatures();
client.registerFeature(new ExperimentalFeatures());
client.registerFeature(new ExperimentalFeatures(config));
client.registerFeature(new OverrideFeatures());
return client;
}
class ExperimentalFeatures implements lc.StaticFeature {
private readonly testExplorer: boolean;
constructor(config: Config) {
this.testExplorer = config.testExplorer || false;
}
getState(): lc.FeatureState {
return { kind: "static" };
}
@ -391,6 +396,7 @@ class ExperimentalFeatures implements lc.StaticFeature {
colorDiagnosticOutput: true,
openServerLogs: true,
localDocs: true,
testExplorer: this.testExplorer,
commands: {
commands: [
"rust-analyzer.runSingle",