Skip to content

Commit 6e7bc07

Browse files
committed
fix: don't override linkedProjects if no workspace was discovered.
1 parent bd545a1 commit 6e7bc07

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

editors/code/src/client.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,12 @@ export async function createClient(
9696
if (resp && Array.isArray(resp)) {
9797
return resp.map((val) => {
9898
return prepareVSCodeConfig(val, (key, cfg) => {
99-
if (key === "linkedProjects") {
99+
// we only want to set discovered workspaces on the right key
100+
// and if a workspace has been discovered.
101+
if (
102+
key === "linkedProjects" &&
103+
config.discoveredWorkspaces.length > 0
104+
) {
100105
cfg[key] = config.discoveredWorkspaces;
101106
}
102107
});

editors/code/src/ctx.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,9 @@ export class Ctx {
205205
const initializationOptions = prepareVSCodeConfig(
206206
rawInitializationOptions,
207207
(key, obj) => {
208-
if (key === "linkedProjects") {
208+
// we only want to set discovered workspaces on the right key
209+
// and if a workspace has been discovered.
210+
if (key === "linkedProjects" && this.config.discoveredWorkspaces.length > 0) {
209211
obj["linkedProjects"] = this.config.discoveredWorkspaces;
210212
}
211213
}

0 commit comments

Comments
 (0)