@@ -348,45 +348,14 @@ export async function workspaceSetupFromCurrentDirectory(context: vscode.Extensi
348
348
return false ;
349
349
}
350
350
351
- let westSelection : WestLocation | undefined = undefined ;
352
-
353
- switch ( westConfigResult . option ) {
354
- case 'use-west-folder' :
355
- // .west folder exists, no additional setup needed
356
- output . appendLine ( "[SETUP] Using existing .west folder" ) ;
357
- break ;
358
-
359
- case 'use-west-yml' :
360
- // Use selected west.yml file
361
- if ( westConfigResult . selectedWestPath ) {
362
- westSelection = {
363
- path : westConfigResult . selectedWestPath ,
364
- failed : false ,
365
- gitRepo : "" ,
366
- additionalArgs : "" ,
367
- } ;
368
- output . appendLine ( `[SETUP] Using west.yml from: ${ westConfigResult . selectedWestPath } ` ) ;
369
- }
370
- break ;
371
-
372
- case 'create-new-west-yml' :
373
- // Use west selector result
374
- westSelection = westConfigResult . westSelection ;
375
- output . appendLine ( "[SETUP] Using new west.yml configuration" ) ;
376
- break ;
377
-
378
- case 'use-external-installation' :
379
- // Handle external installation
380
- if ( westConfigResult . externalInstallPath ) {
381
- return await workspaceSetupOutOfTree ( context , wsConfig , globalConfig ) ;
382
- }
383
- break ;
384
-
385
- default :
386
- vscode . window . showErrorMessage ( "Invalid west configuration option" ) ;
387
- return false ;
351
+ // Handle external installation case
352
+ if ( westConfigResult . useExternalInstallation ) {
353
+ return await workspaceSetupOutOfTree ( context , wsConfig , globalConfig ) ;
388
354
}
389
355
356
+ // Use the westSelection prepared by westConfig
357
+ const westSelection = westConfigResult . westSelection ;
358
+
390
359
await setSetupState ( context , wsConfig , globalConfig , installDir ) ;
391
360
392
361
// Run post-setup process
@@ -750,6 +719,7 @@ export interface WestConfigResult {
750
719
selectedWestPath ?: string ;
751
720
westSelection ?: WestLocation ;
752
721
externalInstallPath ?: string ;
722
+ useExternalInstallation ?: boolean ;
753
723
}
754
724
755
725
/**
@@ -864,6 +834,7 @@ export async function westConfig(
864
834
case 'use-west-folder' :
865
835
// .west folder already exists, nothing more to do
866
836
result . option = 'use-west-folder' ;
837
+ result . westSelection = undefined ; // No west selection needed for existing .west folder
867
838
output . appendLine ( `[WEST CONFIG] Using existing .west folder` ) ;
868
839
break ;
869
840
@@ -875,6 +846,12 @@ export async function westConfig(
875
846
}
876
847
result . selectedWestPath = selectedWestPath ;
877
848
result . option = 'use-west-yml' ;
849
+ result . westSelection = {
850
+ path : selectedWestPath ,
851
+ failed : false ,
852
+ gitRepo : "" ,
853
+ additionalArgs : "" ,
854
+ } ;
878
855
output . appendLine ( `[WEST CONFIG] Selected west.yml from: ${ selectedWestPath } ` ) ;
879
856
break ;
880
857
@@ -909,6 +886,7 @@ export async function westConfig(
909
886
910
887
result . externalInstallPath = selectedInstall . detail ;
911
888
result . option = 'use-external-installation' ;
889
+ result . useExternalInstallation = true ;
912
890
output . appendLine ( `[WEST CONFIG] Selected external installation: ${ selectedInstall . detail } ` ) ;
913
891
break ;
914
892
0 commit comments