|
1 | 1 | import * as path from 'path'; |
2 | 2 | import { Uri } from 'vscode'; |
3 | | -import { showErrorMessage, showQuickPickWithButtons, showWarningMessage } from '../../common/window.apis'; |
4 | | -import { ProjectCreatorString } from '../../common/localize'; |
5 | 3 | import { PythonProject, PythonProjectCreator, PythonProjectCreatorOptions } from '../../api'; |
6 | | -import { PythonProjectManager } from '../../internal.api'; |
7 | | -import { findFiles } from '../../common/workspace.apis'; |
| 4 | +import { ProjectCreatorString } from '../../common/localize'; |
8 | 5 | import { traceInfo } from '../../common/logging'; |
| 6 | +import { showErrorMessage, showQuickPickWithButtons, showWarningMessage } from '../../common/window.apis'; |
| 7 | +import { findFiles } from '../../common/workspace.apis'; |
| 8 | +import { PythonProjectManager, PythonProjectsImpl } from '../../internal.api'; |
9 | 9 |
|
10 | 10 | function getUniqueUri(uris: Uri[]): { |
11 | 11 | label: string; |
@@ -96,11 +96,9 @@ export class AutoFindProjects implements PythonProjectCreator { |
96 | 96 | traceInfo('User cancelled project selection.'); |
97 | 97 | return; |
98 | 98 | } |
99 | | - |
100 | | - const projects = projectUris.map((uri) => ({ |
101 | | - name: path.basename(uri.fsPath), |
102 | | - uri, |
103 | | - })) as PythonProject[]; |
| 99 | + const projects = projectUris.map( |
| 100 | + (uri) => new PythonProjectsImpl(path.basename(uri.fsPath), uri), |
| 101 | + ) as PythonProject[]; |
104 | 102 | // Add the projects to the project manager |
105 | 103 | this.pm.add(projects); |
106 | 104 | return projects; |
|
0 commit comments