Skip to content

Commit 806e5e7

Browse files
authored
Merge branch 'main' into switch-who-handles-adding-project
2 parents 73a4a46 + 04dac71 commit 806e5e7

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

src/api.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -707,18 +707,20 @@ export interface PythonProjectCreator {
707707
readonly iconPath?: IconPath;
708708

709709
/**
710-
711-
* A flag indicating whether the project creator supports quick create where no user input is required.
710+
* Creates a new Python project(s) or, if files are not a project, returns Uri(s) to the created files.
711+
* Anything that needs its own python environment constitutes a project.
712+
* @param options Optional parameters for creating the Python project.
713+
* @returns A promise that resolves to one of the following:
714+
* - PythonProject or PythonProject[]: when a single or multiple projects are created.
715+
* - Uri or Uri[]: when files are created that do not constitute a project.
716+
* - undefined: if project creation fails.
712717
*/
713-
readonly supportsQuickCreate?: boolean;
718+
create(options?: PythonProjectCreatorOptions): Promise<PythonProject | PythonProject[] | Uri | Uri[] | undefined>;
714719

715720
/**
716-
* * Creates a new Python project or projects. The create method is required to add the created project if successful to the
717-
* list of projects.
718-
* @param options - Optional parameters for creating the Python project.
719-
* @returns A promise that resolves to a Python project, an array of Python projects, or undefined.
721+
* A flag indicating whether the project creator supports quick create where no user input is required.
720722
*/
721-
create(options?: PythonProjectCreatorOptions): Promise<PythonProject | PythonProject[] | undefined>;
723+
readonly supportsQuickCreate?: boolean;
722724
}
723725

724726
/**

src/features/creators/existingProjects.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ export class ExistingProjects implements PythonProjectCreator {
1313

1414
constructor(private readonly pm: PythonProjectManager) {}
1515

16-
async create(_options?: PythonProjectCreatorOptions): Promise<PythonProject | PythonProject[] | undefined> {
16+
async create(
17+
_options?: PythonProjectCreatorOptions,
18+
): Promise<PythonProject | PythonProject[] | Uri | Uri[] | undefined> {
1719
const results = await showOpenDialog({
1820
canSelectFiles: true,
1921
canSelectFolders: true,

src/features/envCommands.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ export async function addPythonProjectCommand(
377377
return;
378378
}
379379

380+
380381
let results: PythonProject | PythonProject[] | undefined;
381382
try {
382383
results = await creator.create(options);

0 commit comments

Comments
 (0)