File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -541,12 +541,17 @@ export class LanguageClientManager {
541
541
) ;
542
542
} ,
543
543
handleWorkDoneProgress : ( ( ) => {
544
- let hasPrompted = false ;
544
+ let lastPrompted = new Date ( 0 ) . getTime ( ) ;
545
545
return async ( token , params , next ) => {
546
546
const result = await next ( token , params ) ;
547
- if ( ! hasPrompted && token . toString ( ) . startsWith ( "sourcekitd-crashed" ) ) {
548
- // Only prompt once in case sourcekit is in a crash loop
549
- hasPrompted = true ;
547
+ const now = new Date ( ) . getTime ( ) ;
548
+ const oneHour = 60 * 60 * 1000 ;
549
+ if (
550
+ now - lastPrompted > oneHour &&
551
+ token . toString ( ) . startsWith ( "sourcekitd-crashed" )
552
+ ) {
553
+ // Only prompt once an hour in case sourcekit is in a crash loop
554
+ lastPrompted = now ;
550
555
promptForDiagnostics ( this . workspaceContext ) ;
551
556
}
552
557
return result ;
You can’t perform that action at this time.
0 commit comments