File tree Expand file tree Collapse file tree 3 files changed +7
-4
lines changed
Expand file tree Collapse file tree 3 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -150,7 +150,7 @@ export type LocalQueryCommands = {
150150
151151// Debugger commands
152152export type DebuggerCommands = {
153- "codeQL.debugQuery" : ( uri : Uri ) => Promise < void > ;
153+ "codeQL.debugQuery" : ( uri : Uri | undefined ) => Promise < void > ;
154154 "codeQL.debugQueryContextEditor" : ( uri : Uri ) => Promise < void > ;
155155 "codeQL.startDebuggingSelection" : ( ) => Promise < void > ;
156156 "codeQL.startDebuggingSelectionContextEditor" : ( ) => Promise < void > ;
Original file line number Diff line number Diff line change @@ -185,8 +185,11 @@ export class DebuggerUI
185185 this . sessions . delete ( session . id ) ;
186186 }
187187
188- private async debugQuery ( uri : Uri ) : Promise < void > {
189- const queryPath = validateQueryUri ( uri , false ) ;
188+ private async debugQuery ( uri : Uri | undefined ) : Promise < void > {
189+ const queryPath =
190+ uri !== undefined
191+ ? validateQueryUri ( uri , false )
192+ : await this . localQueries . getCurrentQuery ( false ) ;
190193
191194 // Start debugging with a default configuration that just specifies the query path.
192195 await debug . startDebugging ( undefined , {
Original file line number Diff line number Diff line change @@ -412,7 +412,7 @@ export class LocalQueries extends DisposableObject {
412412 * For now, the "active query" is just whatever query is in the active text editor. Once we have a
413413 * propery "queries" panel, we can provide a way to select the current query there.
414414 */
415- private async getCurrentQuery ( allowLibraryFiles : boolean ) : Promise < string > {
415+ public async getCurrentQuery ( allowLibraryFiles : boolean ) : Promise < string > {
416416 const editor = window . activeTextEditor ;
417417 if ( editor === undefined ) {
418418 throw new Error (
You can’t perform that action at this time.
0 commit comments