@@ -166,31 +166,36 @@ export async function createNewProjectFromSample(wsConfig: WorkspaceConfig) {
166
166
return ;
167
167
}
168
168
169
+ // Show loading QuickPick with no items, just a placeholder
170
+ const loadingQuickPick = vscode . window . createQuickPick ( ) ;
171
+ loadingQuickPick . items = [ ] ;
172
+ loadingQuickPick . busy = true ;
173
+ loadingQuickPick . enabled = false ;
174
+ loadingQuickPick . placeholder = "Loading sample projects... Please wait." ;
175
+ loadingQuickPick . show ( ) ;
176
+
169
177
const samplesDir = await getSamples ( wsConfig . activeSetupState ) ;
170
- const projectList : vscode . QuickPickItem [ ] = samplesDir . map ( x => ( { label : x [ 1 ] , detail : "(" + x [ 0 ] + ") " + x [ 3 ] , description : x [ 2 ] } ) ) ;
171
178
179
+ loadingQuickPick . hide ( ) ;
180
+
181
+ // Show sample selection QuickPick as usual
182
+ const projectList : vscode . QuickPickItem [ ] = samplesDir . map ( x => ( { label : x [ 1 ] , detail : "(" + x [ 0 ] + ") " + x [ 3 ] , description : x [ 2 ] } ) ) ;
172
183
const pickOptions : vscode . QuickPickOptions = {
173
184
ignoreFocusOut : true ,
174
185
matchOnDescription : true ,
175
186
placeHolder : "Select Sample Project" ,
176
187
} ;
177
-
178
188
let selectedSample = await vscode . window . showQuickPick ( projectList , pickOptions ) ;
179
189
if ( selectedSample && selectedSample . detail && selectedSample . label ) {
180
190
let selectedSamplePath = selectedSample . detail . split ( ") " ) [ 1 ] ;
181
-
182
191
const projectDest = await vscode . window . showInputBox ( { title : "Choose Project Destination" , value : path . basename ( selectedSamplePath ) } ) ;
183
-
184
192
if ( projectDest ) {
185
193
const destinationPath = path . join ( wsConfig . rootPath , projectDest ) ;
186
-
187
-
188
194
fs . cpSync ( selectedSamplePath , destinationPath , { recursive : true } ) ;
189
195
let newProjectName = path . basename ( projectDest ) ;
190
196
if ( selectedSample . label !== newProjectName ) {
191
197
changeProjectNameInCMakeFile ( destinationPath , newProjectName ) ;
192
198
}
193
-
194
199
return destinationPath ;
195
200
}
196
201
}
0 commit comments