@@ -14,7 +14,7 @@ import type { ProgressReporter } from "../common/logging/vscode";
1414import { extLogger } from "../common/logging/vscode" ;
1515import type { ProgressMessage , WithProgressId } from "./messages" ;
1616import { progress } from "./messages" ;
17- import type { ProgressCallback , ProgressTask } from "../common/vscode/progress" ;
17+ import type { ProgressCallback } from "../common/vscode/progress" ;
1818import { withProgress } from "../common/vscode/progress" ;
1919import { ServerProcess } from "./server-process" ;
2020import type { App } from "../common/app" ;
@@ -51,12 +51,16 @@ export class QueryServerClient extends DisposableObject {
5151
5252 withProgressReporting : WithProgressReporting ;
5353
54- private readonly queryServerStartListeners = [ ] as Array < ProgressTask < void > > ;
54+ private readonly queryServerStartListeners = [ ] as Array <
55+ ( progress : ProgressCallback ) => void
56+ > ;
5557
5658 // Can't use standard vscode EventEmitter here since they do not cause the calling
5759 // function to fail if one of the event handlers fail. This is something that
5860 // we need here.
59- readonly onDidStartQueryServer = ( e : ProgressTask < void > ) => {
61+ readonly onDidStartQueryServer = (
62+ e : ( progress : ProgressCallback ) => void ,
63+ ) => {
6064 this . queryServerStartListeners . push ( e ) ;
6165 } ;
6266
@@ -105,14 +109,11 @@ export class QueryServerClient extends DisposableObject {
105109 * This resets the unexpected termination count. As hopefully it is an indication that the user has fixed the
106110 * issue.
107111 */
108- async restartQueryServer (
109- progress : ProgressCallback ,
110- token : CancellationToken ,
111- ) : Promise < void > {
112+ async restartQueryServer ( progress : ProgressCallback ) : Promise < void > {
112113 // Reset the unexpected termination count when we restart the query server manually
113114 // or due to config change
114115 this . unexpectedTerminationCount = 0 ;
115- await this . restartQueryServerInternal ( progress , token ) ;
116+ await this . restartQueryServerInternal ( progress ) ;
116117 }
117118
118119 /**
@@ -121,11 +122,9 @@ export class QueryServerClient extends DisposableObject {
121122 private restartQueryServerOnFailure ( ) {
122123 if ( this . unexpectedTerminationCount < MAX_UNEXPECTED_TERMINATIONS ) {
123124 void withProgress (
124- async ( progress , token ) =>
125- this . restartQueryServerInternal ( progress , token ) ,
125+ async ( progress ) => this . restartQueryServerInternal ( progress ) ,
126126 {
127127 title : "Restarting CodeQL query server due to unexpected termination" ,
128- cancellable : true ,
129128 } ,
130129 ) ;
131130 } else {
@@ -145,15 +144,14 @@ export class QueryServerClient extends DisposableObject {
145144 */
146145 private async restartQueryServerInternal (
147146 progress : ProgressCallback ,
148- token : CancellationToken ,
149147 ) : Promise < void > {
150148 this . stopQueryServer ( ) ;
151149 await this . startQueryServer ( ) ;
152150
153151 // Ensure we await all responses from event handlers so that
154152 // errors can be properly reported to the user.
155153 await Promise . all (
156- this . queryServerStartListeners . map ( ( handler ) => handler ( progress , token ) ) ,
154+ this . queryServerStartListeners . map ( ( handler ) => handler ( progress ) ) ,
157155 ) ;
158156 }
159157
0 commit comments