about summary refs log tree commit diff
path: root/editors/code/src/ctx.ts
diff options
context:
space:
mode:
authorDavid Barsky <me@davidbarsky.com>2023-03-14 13:36:21 -0400
committerDavid Barsky <me@davidbarsky.com>2023-03-14 13:36:21 -0400
commit6e7bc07cdf225aea811f793c2f712f25846b8d20 (patch)
tree33fce1fb034b09d0ca79656017e19c27c09f4554 /editors/code/src/ctx.ts
parentbd545a1c106484aa4960737c62450927e1bd8ac7 (diff)
downloadrust-6e7bc07cdf225aea811f793c2f712f25846b8d20.tar.gz
rust-6e7bc07cdf225aea811f793c2f712f25846b8d20.zip
fix: don't override `linkedProjects` if no workspace was discovered.
Diffstat (limited to 'editors/code/src/ctx.ts')
-rw-r--r--editors/code/src/ctx.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index ca30d239c95..ffcfb810a24 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -205,7 +205,9 @@ export class Ctx {
             const initializationOptions = prepareVSCodeConfig(
                 rawInitializationOptions,
                 (key, obj) => {
-                    if (key === "linkedProjects") {
+                    // we only want to set discovered workspaces on the right key
+                    // and if a workspace has been discovered.
+                    if (key === "linkedProjects" && this.config.discoveredWorkspaces.length > 0) {
                         obj["linkedProjects"] = this.config.discoveredWorkspaces;
                     }
                 }