@@ -2,13 +2,14 @@ import { ProgressCallback, ProgressUpdate, withProgress } from "./progress";
22import {
33 CancellationToken ,
44 CancellationTokenSource ,
5+ ExtensionContext ,
56 QuickPickItem ,
67 Range ,
78 Uri ,
89 window ,
910} from "vscode" ;
1011import { BaseLogger , extLogger , Logger , TeeLogger } from "./common" ;
11- import { MAX_QUERIES } from "./config" ;
12+ import { isCanary , MAX_QUERIES } from "./config" ;
1213import { gatherQlFiles } from "./pure/files" ;
1314import { basename } from "path" ;
1415import {
@@ -51,6 +52,7 @@ import { App } from "./common/app";
5152import { DisposableObject } from "./pure/disposable-object" ;
5253import { QueryResultType } from "./pure/new-messages" ;
5354import { redactableError } from "./pure/errors" ;
55+ import { SkeletonQueryWizard } from "./skeleton-query" ;
5456
5557interface DatabaseQuickPickItem extends QuickPickItem {
5658 databaseItem : DatabaseItem ;
@@ -220,6 +222,7 @@ export class LocalQueries extends DisposableObject {
220222 private readonly databaseUI : DatabaseUI ,
221223 private readonly localQueryResultsView : ResultsView ,
222224 private readonly queryStorageDir : string ,
225+ private readonly ctx : ExtensionContext ,
223226 ) {
224227 super ( ) ;
225228 }
@@ -237,6 +240,7 @@ export class LocalQueries extends DisposableObject {
237240 "codeQL.quickEvalContextEditor" : this . quickEval . bind ( this ) ,
238241 "codeQL.codeLensQuickEval" : this . codeLensQuickEval . bind ( this ) ,
239242 "codeQL.quickQuery" : this . quickQuery . bind ( this ) ,
243+ "codeQL.createSkeletonQuery" : this . createSkeletonQuery . bind ( this ) ,
240244 } ;
241245 }
242246
@@ -375,6 +379,27 @@ export class LocalQueries extends DisposableObject {
375379 ) ;
376380 }
377381
382+ private async createSkeletonQuery ( ) : Promise < void > {
383+ await withProgress (
384+ async ( progress : ProgressCallback , token : CancellationToken ) => {
385+ const credentials = isCanary ( ) ? this . app . credentials : undefined ;
386+ const skeletonQueryWizard = new SkeletonQueryWizard (
387+ this . cliServer ,
388+ this . ctx . storageUri ?. fsPath ,
389+ progress ,
390+ credentials ,
391+ extLogger ,
392+ this . databaseManager ,
393+ token ,
394+ ) ;
395+ await skeletonQueryWizard . execute ( ) ;
396+ } ,
397+ {
398+ title : "Create Query" ,
399+ } ,
400+ ) ;
401+ }
402+
378403 /**
379404 * Creates a new `LocalQueryRun` object to track a query evaluation. This creates a timestamp
380405 * file in the query's output directory, creates a `LocalQueryInfo` object, and registers that
0 commit comments