@@ -134,14 +134,57 @@ export async function pickCreator(creators: PythonProjectCreator[]): Promise<Pyt
134134 return creators [ 0 ] ;
135135 }
136136
137- const items : ( QuickPickItem & { c : PythonProjectCreator } ) [ ] = creators . map ( ( c ) => ( {
138- label : c . displayName ?? c . name ,
139- description : c . description ,
140- c : c ,
141- } ) ) ;
137+ // First level menu
138+ const autoFindCreator = creators . find ( ( c ) => c . name === 'autoProjects' ) ;
139+ const existingProjectsCreator = creators . find ( ( c ) => c . name === 'existingProjects' ) ;
140+ const otherCreators = creators . filter ( ( c ) => c . name !== 'autoProjects' && c . name !== 'existingProjects' ) ;
141+
142+ const items : QuickPickItem [ ] = [
143+ {
144+ label : 'Auto Find' ,
145+ description : autoFindCreator ?. description ?? 'Automatically find Python projects' ,
146+ } ,
147+ {
148+ label : 'Select Existing' ,
149+ description : existingProjectsCreator ?. description ?? 'Select existing Python projects' ,
150+ } ,
151+ {
152+ label : 'Create New' ,
153+ description : 'Create a Python project from a template' ,
154+ } ,
155+ ] ;
156+
142157 const selected = await showQuickPick ( items , {
143158 placeHolder : Pickers . Managers . selectProjectCreator ,
144159 ignoreFocusOut : true ,
145160 } ) ;
146- return ( selected as { c : PythonProjectCreator } ) ?. c ;
161+
162+ if ( ! selected ) {
163+ return undefined ;
164+ }
165+
166+ // Return appropriate creator based on selection
167+ switch ( selected . label ) {
168+ case 'Auto Find' :
169+ return autoFindCreator ;
170+ case 'Select Existing' :
171+ return existingProjectsCreator ;
172+ case 'Create New' :
173+ // Show second level menu for other creators
174+ if ( otherCreators . length === 0 ) {
175+ return undefined ;
176+ }
177+ const newItems : ( QuickPickItem & { c : PythonProjectCreator } ) [ ] = otherCreators . map ( ( c ) => ( {
178+ label : c . displayName ?? c . name ,
179+ description : c . description ,
180+ c : c ,
181+ } ) ) ;
182+ const newSelected = await showQuickPick ( newItems , {
183+ placeHolder : 'Select project type for new project' ,
184+ ignoreFocusOut : true ,
185+ } ) ;
186+ return newSelected ?. c ;
187+ }
188+
189+ return undefined ;
147190}
0 commit comments