fix: don't override linkedProjects if no workspace was discovered.

This commit is contained in:
David Barsky 2023-03-14 13:36:21 -04:00
parent bd545a1c10
commit 6e7bc07cdf
2 changed files with 9 additions and 2 deletions

View File

@ -96,7 +96,12 @@ export async function createClient(
if (resp && Array.isArray(resp)) { if (resp && Array.isArray(resp)) {
return resp.map((val) => { return resp.map((val) => {
return prepareVSCodeConfig(val, (key, cfg) => { return prepareVSCodeConfig(val, (key, cfg) => {
if (key === "linkedProjects") { // we only want to set discovered workspaces on the right key
// and if a workspace has been discovered.
if (
key === "linkedProjects" &&
config.discoveredWorkspaces.length > 0
) {
cfg[key] = config.discoveredWorkspaces; cfg[key] = config.discoveredWorkspaces;
} }
}); });

View File

@ -205,7 +205,9 @@ export class Ctx {
const initializationOptions = prepareVSCodeConfig( const initializationOptions = prepareVSCodeConfig(
rawInitializationOptions, rawInitializationOptions,
(key, obj) => { (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; obj["linkedProjects"] = this.config.discoveredWorkspaces;
} }
} }