File tree Expand file tree Collapse file tree 3 files changed +14
-9
lines changed
Expand file tree Collapse file tree 3 files changed +14
-9
lines changed Original file line number Diff line number Diff 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/**
Original file line number Diff line number Diff 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 ,
Original file line number Diff line number Diff 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 ) ;
You can’t perform that action at this time.
0 commit comments