|
1 | 1 | import * as path from 'path'; |
| 2 | +import { Uri, window, workspace } from 'vscode'; |
2 | 3 | import { PythonProject, PythonProjectCreator, PythonProjectCreatorOptions } from '../../api'; |
3 | 4 | import { ProjectCreatorString } from '../../common/localize'; |
| 5 | +import { traceInfo, traceLog } from '../../common/logging'; |
4 | 6 | import { showOpenDialog, showWarningMessage } from '../../common/window.apis'; |
5 | | -import { PythonProjectManager } from '../../internal.api'; |
6 | | -import { traceInfo } from '../../common/logging'; |
7 | | -import { Uri, window, workspace } from 'vscode'; |
8 | | -import { traceLog } from '../../common/logging'; |
| 7 | +import { PythonProjectManager, PythonProjectsImpl } from '../../internal.api'; |
9 | 8 |
|
10 | 9 | export class ExistingProjects implements PythonProjectCreator { |
11 | 10 | public readonly name = 'existingProjects'; |
@@ -90,10 +89,9 @@ export class ExistingProjects implements PythonProjectCreator { |
90 | 89 | } |
91 | 90 | return; |
92 | 91 | } else { |
93 | | - const projects = resultsInWorkspace.map((uri) => ({ |
94 | | - name: path.basename(uri.fsPath), |
95 | | - uri, |
96 | | - })) as PythonProject[]; |
| 92 | + const projects = resultsInWorkspace.map( |
| 93 | + (uri) => new PythonProjectsImpl(path.basename(uri.fsPath), uri), |
| 94 | + ) as PythonProject[]; |
97 | 95 | // Add the projects to the project manager |
98 | 96 | this.pm.add(projects); |
99 | 97 | return projects; |
|
0 commit comments