Skip to content

Commit 6b83ba6

Browse files
committed
pm add in existing creators
1 parent fd5d686 commit 6b83ba6

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/features/creators/autoFindProjects.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,19 @@ export class AutoFindProjects implements PythonProjectCreator {
9191

9292
traceInfo(`Found ${filtered.length} new potential projects that aren't already registered`);
9393

94-
const projects = await pickProjects(filtered);
95-
if (!projects || projects.length === 0) {
94+
const projectUris = await pickProjects(filtered);
95+
if (!projectUris || projectUris.length === 0) {
9696
// User cancelled the selection.
9797
traceInfo('User cancelled project selection.');
9898
return;
9999
}
100100

101-
return projects.map((uri) => ({
101+
const projects = projectUris.map((uri) => ({
102102
name: path.basename(uri.fsPath),
103103
uri,
104-
}));
104+
})) as PythonProject[];
105+
// Add the projects to the project manager
106+
this.pm.add(projects);
107+
return projects;
105108
}
106109
}

src/features/creators/existingProjects.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ export class ExistingProjects implements PythonProjectCreator {
8888
}
8989
return;
9090
} else {
91-
return resultsInWorkspace.map((uri) => ({
91+
const projects = resultsInWorkspace.map((uri) => ({
9292
name: path.basename(uri.fsPath),
9393
uri,
9494
})) as PythonProject[];
95+
// Add the projects to the project manager
96+
this.pm.add(projects);
97+
return projects;
9598
}
9699
}
97100
}

0 commit comments

Comments
 (0)