File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -467,7 +467,9 @@ export async function convertLgtmUrlToDatabaseUrl(
467467 }
468468 }
469469
470- const language = await promptForLanguage ( projectJson , progress ) ;
470+ const languages = projectJson ?. languages ?. map ( ( lang : { language : string } ) => lang . language ) || [ ] ;
471+
472+ const language = await promptForLanguage ( languages , progress ) ;
471473 if ( ! language ) {
472474 return ;
473475 }
@@ -495,25 +497,27 @@ async function downloadLgtmProjectMetadata(lgtmUrl: string): Promise<any> {
495497}
496498
497499async function promptForLanguage (
498- projectJson : any ,
500+ languages : string [ ] ,
499501 progress : ProgressCallback
500502) : Promise < string | undefined > {
501503 progress ( {
502504 message : 'Choose language' ,
503505 step : 2 ,
504506 maxStep : 2
505507 } ) ;
506- if ( ! projectJson ?. languages ? .length ) {
508+ if ( ! languages . length ) {
507509 return ;
508510 }
509- if ( projectJson . languages . length === 1 ) {
510- return projectJson . languages [ 0 ] . language ;
511+ if ( languages . length === 1 ) {
512+ return languages [ 0 ] ;
511513 }
512514
513515 return await window . showQuickPick (
514- projectJson . languages . map ( ( lang : { language : string } ) => lang . language ) , {
515- placeHolder : 'Select the database language to download:'
516- }
516+ languages ,
517+ {
518+ placeHolder : 'Select the database language to download:' ,
519+ ignoreFocusOut : true ,
520+ }
517521 ) ;
518522}
519523
You can’t perform that action at this time.
0 commit comments