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"
12201224 "command" : " codeQL.quickEval" ,
12211225 "when" : " editorLangId == ql"
12221226 },
1227+ {
1228+ "command" : " codeQL.quickEvalCount" ,
1229+ "when" : " editorLangId == ql && codeql.supportsQuickEvalCount"
1230+ },
12231231 {
12241232 "command" : " codeQL.quickEvalContextEditor" ,
12251233 "when" : " false"
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ export type LocalQueryCommands = {
133133 "codeQLQueries.runLocalQueryFromQueriesPanel" : TreeViewContextSingleSelectionCommandFunction < QueryTreeViewItem > ;
134134 "codeQL.runQueries" : ExplorerSelectionCommandFunction < Uri > ;
135135 "codeQL.quickEval" : ( uri : Uri ) => Promise < void > ;
136+ "codeQL.quickEvalCount" : ( uri : Uri ) => Promise < void > ;
136137 "codeQL.quickEvalContextEditor" : ( uri : Uri ) => Promise < void > ;
137138 "codeQL.codeLensQuickEval" : ( uri : Uri , range : Range ) => Promise < void > ;
138139 "codeQL.quickQuery" : ( ) => Promise < void > ;
Original file line number Diff line number Diff line change @@ -107,6 +107,7 @@ export class LocalQueries extends DisposableObject {
107107 this . runQueries . bind ( this ) ,
108108 ) ,
109109 "codeQL.quickEval" : this . quickEval . bind ( this ) ,
110+ "codeQL.quickEvalCount" : this . quickEvalCount . bind ( this ) ,
110111 "codeQL.quickEvalContextEditor" : this . quickEval . bind ( this ) ,
111112 "codeQL.codeLensQuickEval" : this . codeLensQuickEval . bind ( this ) ,
112113 "codeQL.quickQuery" : this . quickQuery . bind ( this ) ,
@@ -240,6 +241,29 @@ export class LocalQueries extends DisposableObject {
240241 ) ;
241242 }
242243
244+ private async quickEvalCount ( uri : Uri ) : Promise < void > {
245+ await withProgress (
246+ async ( progress , token ) => {
247+ if ( ! ( await this . cliServer . cliConstraints . supportsQuickEvalCount ( ) ) ) {
248+ throw new Error (
249+ "Quick evaluation counts is not supported by this version of CodeQL CLI." ,
250+ ) ;
251+ }
252+ await this . compileAndRunQuery (
253+ QuickEvalType . QuickEvalCount ,
254+ uri ,
255+ progress ,
256+ token ,
257+ undefined ,
258+ ) ;
259+ } ,
260+ {
261+ title : "Running query" ,
262+ cancellable : true ,
263+ } ,
264+ ) ;
265+ }
266+
243267 private async codeLensQuickEval ( uri : Uri , range : Range ) : Promise < void > {
244268 await withProgress (
245269 async ( progress , token ) =>
You can’t perform that action at this time.
0 commit comments