@@ -86,6 +86,7 @@ export async function promptImportInternetDatabase(
8686 * @param progress the progress callback
8787 * @param cli the CodeQL CLI server
8888 * @param language the language to download. If undefined, the user will be prompted to choose a language.
89+ * @param makeSelected make the new database selected in the databases panel (default: true)
8990 */
9091export async function promptImportGithubDatabase (
9192 commandManager : AppCommandManager ,
@@ -95,6 +96,7 @@ export async function promptImportGithubDatabase(
9596 progress : ProgressCallback ,
9697 cli ?: CodeQLCliServer ,
9798 language ?: string ,
99+ makeSelected = true ,
98100) : Promise < DatabaseItem | undefined > {
99101 const githubRepo = await askForGitHubRepo ( progress ) ;
100102 if ( ! githubRepo ) {
@@ -109,10 +111,13 @@ export async function promptImportGithubDatabase(
109111 progress ,
110112 cli ,
111113 language ,
114+ makeSelected ,
112115 ) ;
113116
114117 if ( databaseItem ) {
115- await commandManager . execute ( "codeQLDatabases.focus" ) ;
118+ if ( makeSelected ) {
119+ await commandManager . execute ( "codeQLDatabases.focus" ) ;
120+ }
116121 void showAndLogInformationMessage (
117122 extLogger ,
118123 "Database downloaded and imported successfully." ,
@@ -157,6 +162,7 @@ export async function askForGitHubRepo(
157162 * @param progress the progress callback
158163 * @param cli the CodeQL CLI server
159164 * @param language the language to download. If undefined, the user will be prompted to choose a language.
165+ * @param makeSelected make the new database selected in the databases panel (default: true)
160166 **/
161167export async function downloadGitHubDatabase (
162168 githubRepo : string ,
@@ -166,6 +172,7 @@ export async function downloadGitHubDatabase(
166172 progress : ProgressCallback ,
167173 cli ?: CodeQLCliServer ,
168174 language ?: string ,
175+ makeSelected = true ,
169176) : Promise < DatabaseItem | undefined > {
170177 const nwo = getNwoFromGitHubUrl ( githubRepo ) || githubRepo ;
171178 if ( ! isValidGitHubNwo ( nwo ) ) {
@@ -210,6 +217,7 @@ export async function downloadGitHubDatabase(
210217 `${ owner } /${ name } ` ,
211218 progress ,
212219 cli ,
220+ makeSelected ,
213221 ) ;
214222}
215223
@@ -268,6 +276,7 @@ export async function importArchiveDatabase(
268276 * @param storagePath where to store the unzipped database.
269277 * @param nameOverride a name for the database that overrides the default
270278 * @param progress callback to send progress messages to
279+ * @param makeSelected make the new database selected in the databases panel (default: true)
271280 */
272281async function databaseArchiveFetcher (
273282 databaseUrl : string ,
@@ -277,6 +286,7 @@ async function databaseArchiveFetcher(
277286 nameOverride : string | undefined ,
278287 progress : ProgressCallback ,
279288 cli ?: CodeQLCliServer ,
289+ makeSelected = true ,
280290) : Promise < DatabaseItem > {
281291 progress ( {
282292 message : "Getting database" ,
@@ -315,8 +325,6 @@ async function databaseArchiveFetcher(
315325 } ) ;
316326 await ensureZippedSourceLocation ( dbPath ) ;
317327
318- const makeSelected = true ;
319-
320328 const item = await databaseManager . openDatabase (
321329 Uri . file ( dbPath ) ,
322330 makeSelected ,
0 commit comments