Skip to content

Commit fd5d686

Browse files
committed
support arrays
1 parent b6edc9f commit fd5d686

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/features/envCommands.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ export async function setPackageManagerCommand(em: EnvironmentManagers, wm: Pyth
335335
* This function calls create on the selected creator and handles the creation process. Will return
336336
* without doing anything if the resource is a ProjectItem, as the project is already created.
337337
*
338-
* @param resource - The resource to use for project creation (can be a Uri, ProjectItem, or undefined).
338+
* @param resource - The resource to use for project creation (can be a Uri(s), ProjectItem(s), or undefined).
339339
* @param wm - The PythonProjectManager instance for managing projects.
340340
* @param em - The EnvironmentManagers instance for managing environments.
341341
* @param pc - The ProjectCreators instance for accessing available project creators.
@@ -351,6 +351,12 @@ export async function addPythonProjectCommand(
351351
showErrorMessage('Please open a folder/project before adding a workspace');
352352
return;
353353
}
354+
if (resource instanceof Array) {
355+
for (const r of resource) {
356+
await addPythonProjectCommand(r, wm, em, pc);
357+
return;
358+
}
359+
}
354360
if (resource instanceof ProjectItem) {
355361
// If the context is a ProjectItem, project is already created. Just add it to the package manager project list.
356362
wm.add(resource.project);

0 commit comments

Comments
 (0)