Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/ctx.ts')
-rw-r--r--editors/code/src/ctx.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 55163241c2..01a3aca132 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -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;
}