mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
feature: Add a UnindexedProject
notification and a corresponding setting.
This commit is contained in:
parent
ca44e1ee9f
commit
6330b028b3
14 changed files with 262 additions and 8 deletions
|
@ -234,6 +234,23 @@ export class Ctx implements RustAnalyzerExtensionApi {
|
|||
this.outputChannel!.show();
|
||||
}),
|
||||
);
|
||||
this.pushClientCleanup(
|
||||
this._client.onNotification(ra.unindexedProject, async (params) => {
|
||||
if (this.config.discoverProjectRunner) {
|
||||
const command = `${this.config.discoverProjectRunner}.discoverWorkspaceCommand`;
|
||||
log.info(`running command: ${command}`);
|
||||
const uris = params.textDocuments.map((doc) =>
|
||||
vscode.Uri.parse(doc.uri, true),
|
||||
);
|
||||
const projects: JsonProject[] = await vscode.commands.executeCommand(
|
||||
command,
|
||||
uris,
|
||||
);
|
||||
this.setWorkspaces(projects);
|
||||
await this.notifyRustAnalyzer();
|
||||
}
|
||||
}),
|
||||
);
|
||||
}
|
||||
return this._client;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue