Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/src/commands.ts')
-rw-r--r--editors/code/src/commands.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index a8ec75a78a..8a953577e9 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -758,14 +758,20 @@ export function addProject(ctx: CtxInit): Cmd {
const workspaces: JsonProject[] = await Promise.all(
vscode.workspace.workspaceFolders!.map(async (folder): Promise<JsonProject> => {
- return discoverWorkspace(vscode.workspace.textDocuments, discoverProjectCommand, {
+ const rustDocuments = vscode.workspace.textDocuments.filter(isRustDocument);
+ return discoverWorkspace(rustDocuments, discoverProjectCommand, {
cwd: folder.uri.fsPath,
});
})
);
- await ctx.client.sendRequest(ra.addProject, {
- project: workspaces,
+ ctx.addToDiscoveredWorkspaces(workspaces);
+
+ // this is a workaround to avoid needing writing the `rust-project.json` into
+ // a workspace-level VS Code-specific settings folder. We'd like to keep the
+ // `rust-project.json` entirely in-memory.
+ await ctx.client?.sendNotification(lc.DidChangeConfigurationNotification.type, {
+ settings: "",
});
};
}