Skip to content

Commit b1fe45a

Browse files
committed
update add project to else statement
1 parent d2072b0 commit b1fe45a

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/features/envCommands.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,6 @@ export async function addPythonProject(
348348
return;
349349
}
350350

351-
if (
352-
resource instanceof ProjectPackageRootTreeItem ||
353-
resource instanceof ProjectPackage ||
354-
resource instanceof ProjectEnvironment
355-
) {
356-
357-
await addPythonProject(undefined, wm, em, pc);
358-
}
359-
360351
if (resource instanceof Uri) {
361352
const uri = resource as Uri;
362353
const envManagerId = getDefaultEnvManagerSetting(wm, uri);
@@ -421,6 +412,9 @@ export async function addPythonProject(
421412
}
422413
await addPythonProjectSetting(edits);
423414
return projects;
415+
} else {
416+
// If the context is not a Uri or ProjectItem, rerun function with undefined context
417+
await addPythonProject(undefined, wm, em, pc);
424418
}
425419
}
426420

0 commit comments

Comments
 (0)