@@ -208,6 +208,13 @@ export class DatabaseUI extends DisposableObject {
208208
209209 public getCommands ( ) : LocalDatabasesCommands {
210210 return {
211+ "codeQL.chooseDatabaseFolder" :
212+ this . handleChooseDatabaseFolderFromPalette . bind ( this ) ,
213+ "codeQL.chooseDatabaseArchive" :
214+ this . handleChooseDatabaseArchiveFromPalette . bind ( this ) ,
215+ "codeQL.chooseDatabaseInternet" :
216+ this . handleChooseDatabaseInternet . bind ( this ) ,
217+ "codeQL.chooseDatabaseGithub" : this . handleChooseDatabaseGithub . bind ( this ) ,
211218 "codeQL.setCurrentDatabase" : this . handleSetCurrentDatabase . bind ( this ) ,
212219 "codeQL.setDefaultTourDatabase" :
213220 this . handleSetDefaultTourDatabase . bind ( this ) ,
@@ -242,7 +249,7 @@ export class DatabaseUI extends DisposableObject {
242249 await this . databaseManager . setCurrentDatabaseItem ( databaseItem ) ;
243250 }
244251
245- public async chooseDatabaseFolder (
252+ private async chooseDatabaseFolder (
246253 progress : ProgressCallback ,
247254 token : CancellationToken ,
248255 ) : Promise < void > {
@@ -268,6 +275,17 @@ export class DatabaseUI extends DisposableObject {
268275 ) ;
269276 }
270277
278+ private async handleChooseDatabaseFolderFromPalette ( ) : Promise < void > {
279+ return withProgress (
280+ async ( progress , token ) => {
281+ await this . chooseDatabaseFolder ( progress , token ) ;
282+ } ,
283+ {
284+ title : "Choose a Database from a Folder" ,
285+ } ,
286+ ) ;
287+ }
288+
271289 private async handleSetDefaultTourDatabase ( ) : Promise < void > {
272290 return withProgress (
273291 async ( progress , token ) => {
@@ -392,7 +410,7 @@ export class DatabaseUI extends DisposableObject {
392410 }
393411 }
394412
395- public async chooseDatabaseArchive (
413+ private async chooseDatabaseArchive (
396414 progress : ProgressCallback ,
397415 token : CancellationToken ,
398416 ) : Promise < void > {
@@ -418,50 +436,47 @@ export class DatabaseUI extends DisposableObject {
418436 ) ;
419437 }
420438
421- public async chooseDatabaseInternet (
422- progress : ProgressCallback ,
423- token : CancellationToken ,
424- ) : Promise < DatabaseItem | undefined > {
425- return await promptImportInternetDatabase (
426- this . databaseManager ,
427- this . storagePath ,
428- progress ,
429- token ,
430- this . queryServer ?. cliServer ,
439+ private async handleChooseDatabaseArchiveFromPalette ( ) : Promise < void > {
440+ return withProgress (
441+ async ( progress , token ) => {
442+ await this . chooseDatabaseArchive ( progress , token ) ;
443+ } ,
444+ {
445+ title : "Choose a Database from an Archive" ,
446+ } ,
431447 ) ;
432448 }
433449
434450 private async handleChooseDatabaseInternet ( ) : Promise < void > {
435451 return withProgress (
436452 async ( progress , token ) => {
437- await this . chooseDatabaseInternet ( progress , token ) ;
453+ await promptImportInternetDatabase (
454+ this . databaseManager ,
455+ this . storagePath ,
456+ progress ,
457+ token ,
458+ this . queryServer ?. cliServer ,
459+ ) ;
438460 } ,
439461 {
440462 title : "Adding database from URL" ,
441463 } ,
442464 ) ;
443465 }
444466
445- public async chooseDatabaseGithub (
446- progress : ProgressCallback ,
447- token : CancellationToken ,
448- ) : Promise < DatabaseItem | undefined > {
449- const credentials = isCanary ( ) ? this . app . credentials : undefined ;
450-
451- return await promptImportGithubDatabase (
452- this . databaseManager ,
453- this . storagePath ,
454- credentials ,
455- progress ,
456- token ,
457- this . queryServer ?. cliServer ,
458- ) ;
459- }
460-
461467 private async handleChooseDatabaseGithub ( ) : Promise < void > {
462468 return withProgress (
463469 async ( progress , token ) => {
464- await this . chooseDatabaseGithub ( progress , token ) ;
470+ const credentials = isCanary ( ) ? this . app . credentials : undefined ;
471+
472+ await promptImportGithubDatabase (
473+ this . databaseManager ,
474+ this . storagePath ,
475+ credentials ,
476+ progress ,
477+ token ,
478+ this . queryServer ?. cliServer ,
479+ ) ;
465480 } ,
466481 {
467482 title : "Adding database from GitHub" ,
0 commit comments