File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 457457 "command" : " codeQL.quickEval" ,
458458 "title" : " CodeQL: Quick Evaluation"
459459 },
460+ {
461+ "command" : " codeQL.quickEvalCount" ,
462+ "title" : " CodeQL: Quick Evaluation Count"
463+ },
460464 {
461465 "command" : " codeQL.quickEvalContextEditor" ,
462466 "title" : " CodeQL: Quick Evaluation"
11971201 "command" : " codeQL.quickEval" ,
11981202 "when" : " editorLangId == ql"
11991203 },
1204+ {
1205+ "command" : " codeQL.quickEvalCount" ,
1206+ "when" : " editorLangId == ql && codeql.supportsQuickEvalCount"
1207+ },
12001208 {
12011209 "command" : " codeQL.quickEvalContextEditor" ,
12021210 "when" : " false"
Original file line number Diff line number Diff line change @@ -131,6 +131,7 @@ export type LocalQueryCommands = {
131131 ) => Promise < void > ;
132132 "codeQL.runQueries" : ExplorerSelectionCommandFunction < Uri > ;
133133 "codeQL.quickEval" : ( uri : Uri ) => Promise < void > ;
134+ "codeQL.quickEvalCount" : ( uri : Uri ) => Promise < void > ;
134135 "codeQL.quickEvalContextEditor" : ( uri : Uri ) => Promise < void > ;
135136 "codeQL.codeLensQuickEval" : ( uri : Uri , range : Range ) => Promise < void > ;
136137 "codeQL.quickQuery" : ( ) => Promise < void > ;
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ export class LocalQueries extends DisposableObject {
104104 this . runQueries . bind ( this ) ,
105105 ) ,
106106 "codeQL.quickEval" : this . quickEval . bind ( this ) ,
107+ "codeQL.quickEvalCount" : this . quickEvalCount . bind ( this ) ,
107108 "codeQL.quickEvalContextEditor" : this . quickEval . bind ( this ) ,
108109 "codeQL.codeLensQuickEval" : this . codeLensQuickEval . bind ( this ) ,
109110 "codeQL.quickQuery" : this . quickQuery . bind ( this ) ,
@@ -231,6 +232,29 @@ export class LocalQueries extends DisposableObject {
231232 ) ;
232233 }
233234
235+ private async quickEvalCount ( uri : Uri ) : Promise < void > {
236+ await withProgress (
237+ async ( progress , token ) => {
238+ if ( ! ( await this . cliServer . cliConstraints . supportsQuickEvalCount ( ) ) ) {
239+ throw new Error (
240+ "Quick evaluation counts is not supported by this version of CodeQL CLI." ,
241+ ) ;
242+ }
243+ await this . compileAndRunQuery (
244+ QuickEvalType . QuickEvalCount ,
245+ uri ,
246+ progress ,
247+ token ,
248+ undefined ,
249+ ) ;
250+ } ,
251+ {
252+ title : "Running query" ,
253+ cancellable : true ,
254+ } ,
255+ ) ;
256+ }
257+
234258 private async codeLensQuickEval ( uri : Uri , range : Range ) : Promise < void > {
235259 await withProgress (
236260 async ( progress , token ) =>
You can’t perform that action at this time.
0 commit comments