@@ -26,6 +26,8 @@ import type { LocalQueries } from "./local-queries";
2626import { tryGetQueryMetadata } from "../codeql-cli/query-metadata" ;
2727import { telemetryListener } from "../common/vscode/telemetry" ;
2828import type { Disposable } from "../common/disposable-object" ;
29+ import type { ProgressCallback } from "../common/vscode/progress" ;
30+ import { progressUpdate } from "../common/vscode/progress" ;
2931
3032function formatResultMessage ( result : CoreQueryResults ) : string {
3133 switch ( result . resultType ) {
@@ -79,23 +81,31 @@ export class LocalQueryRun {
7981 * This function must be called when the evaluation completes, whether the evaluation was
8082 * successful or not.
8183 * */
82- public async complete ( results : CoreQueryResults ) : Promise < void > {
84+ public async complete (
85+ results : CoreQueryResults ,
86+ progress : ProgressCallback ,
87+ ) : Promise < void > {
8388 const evalLogPaths = await this . summarizeEvalLog (
8489 results . resultType ,
8590 this . outputDir ,
8691 this . logger ,
92+ progress ,
8793 ) ;
8894 if ( evalLogPaths !== undefined ) {
8995 this . queryInfo . setEvaluatorLogPaths ( evalLogPaths ) ;
9096 }
97+ progress ( progressUpdate ( 1 , 4 , "Getting completed query info" ) ) ;
9198 const queryWithResults = await this . getCompletedQueryInfo ( results ) ;
99+ progress ( progressUpdate ( 2 , 4 , "Updating query history" ) ) ;
92100 this . queryHistoryManager . completeQuery ( this . queryInfo , queryWithResults ) ;
101+ progress ( progressUpdate ( 3 , 4 , "Showing results" ) ) ;
93102 await this . localQueries . showResultsForCompletedQuery (
94103 this . queryInfo as CompletedLocalQueryInfo ,
95104 WebviewReveal . Forced ,
96105 ) ;
97106 // Note we must update the query history view after showing results as the
98107 // display and sorting might depend on the number of results
108+ progress ( progressUpdate ( 4 , 4 , "Updating query history" ) ) ;
99109 await this . queryHistoryManager . refreshTreeView ( ) ;
100110
101111 this . logger . dispose ( ) ;
@@ -109,6 +119,7 @@ export class LocalQueryRun {
109119 QueryResultType . OTHER_ERROR ,
110120 this . outputDir ,
111121 this . logger ,
122+ ( _ ) => { } ,
112123 ) ;
113124 if ( evalLogPaths !== undefined ) {
114125 this . queryInfo . setEvaluatorLogPaths ( evalLogPaths ) ;
@@ -128,10 +139,12 @@ export class LocalQueryRun {
128139 resultType : QueryResultType ,
129140 outputDir : QueryOutputDir ,
130141 logger : BaseLogger ,
142+ progress : ProgressCallback ,
131143 ) : Promise < EvaluatorLogPaths | undefined > {
132144 const evalLogPaths = await generateEvalLogSummaries (
133145 this . cliServer ,
134146 outputDir ,
147+ progress ,
135148 ) ;
136149 if ( evalLogPaths !== undefined ) {
137150 if ( evalLogPaths . endSummary !== undefined ) {
0 commit comments