@@ -329,8 +329,8 @@ export function formatMessage<T extends protocol.Message>(msg: T, logger: Logger
329329 * Allows to schedule next step in multistep operation
330330 */
331331interface NextStep {
332- immediate ( action : ( ) => void ) : void ;
333- delay ( ms : number , action : ( ) => void ) : void ;
332+ immediate ( actionType : string , action : ( ) => void ) : void ;
333+ delay ( actionType : string , ms : number , action : ( ) => void ) : void ;
334334}
335335
336336/**
@@ -371,22 +371,22 @@ class MultistepOperation implements NextStep {
371371 this . setImmediateId ( undefined ) ;
372372 }
373373
374- public immediate ( action : ( ) => void ) {
374+ public immediate ( actionType : string , action : ( ) => void ) {
375375 const requestId = this . requestId ! ;
376376 Debug . assert ( requestId === this . operationHost . getCurrentRequestId ( ) , "immediate: incorrect request id" ) ;
377377 this . setImmediateId ( this . operationHost . getServerHost ( ) . setImmediate ( ( ) => {
378378 this . immediateId = undefined ;
379379 this . operationHost . executeWithRequestId ( requestId , ( ) => this . executeAction ( action ) ) ;
380- } ) ) ;
380+ } , actionType ) ) ;
381381 }
382382
383- public delay ( ms : number , action : ( ) => void ) {
383+ public delay ( actionType : string , ms : number , action : ( ) => void ) {
384384 const requestId = this . requestId ! ;
385385 Debug . assert ( requestId === this . operationHost . getCurrentRequestId ( ) , "delay: incorrect request id" ) ;
386386 this . setTimerHandle ( this . operationHost . getServerHost ( ) . setTimeout ( ( ) => {
387387 this . timerHandle = undefined ;
388388 this . operationHost . executeWithRequestId ( requestId , ( ) => this . executeAction ( action ) ) ;
389- } , ms ) ) ;
389+ } , ms , actionType ) ) ;
390390 }
391391
392392 private executeAction ( action : ( next : NextStep ) => void ) {
@@ -1271,7 +1271,7 @@ export class Session<TMessage = string> implements EventSender {
12711271 const goNext = ( ) => {
12721272 index ++ ;
12731273 if ( checkList . length > index ) {
1274- next . delay ( followMs , checkOne ) ;
1274+ next . delay ( "checkOne" , followMs , checkOne ) ;
12751275 }
12761276 } ;
12771277 const checkOne = ( ) => {
@@ -1308,7 +1308,7 @@ export class Session<TMessage = string> implements EventSender {
13081308 goNext ( ) ;
13091309 return ;
13101310 }
1311- next . immediate ( ( ) => {
1311+ next . immediate ( "semanticCheck" , ( ) => {
13121312 this . semanticCheck ( fileName , project ) ;
13131313 if ( this . changeSeq !== seq ) {
13141314 return ;
@@ -1318,15 +1318,15 @@ export class Session<TMessage = string> implements EventSender {
13181318 goNext ( ) ;
13191319 return ;
13201320 }
1321- next . immediate ( ( ) => {
1321+ next . immediate ( "suggestionCheck" , ( ) => {
13221322 this . suggestionCheck ( fileName , project ) ;
13231323 goNext ( ) ;
13241324 } ) ;
13251325 } ) ;
13261326 } ;
13271327
13281328 if ( checkList . length > index && this . changeSeq === seq ) {
1329- next . delay ( ms , checkOne ) ;
1329+ next . delay ( "checkOne" , ms , checkOne ) ;
13301330 }
13311331 }
13321332
0 commit comments