@@ -894,16 +894,18 @@ function realActivate(context: ExtensionContext): void {
894
894
const configFileFilter : DocumentFilter = { scheme : 'file' , pattern : '**/.eslintr{c.js,c.yaml,c.yml,c,c.json}' } ;
895
895
const syncedDocuments : Map < string , TextDocument > = new Map < string , TextDocument > ( ) ;
896
896
897
- Workspace . onDidChangeConfiguration ( ( ) => {
897
+ Workspace . onDidChangeConfiguration ( async ( ) => {
898
898
probeFailed . clear ( ) ;
899
899
for ( const textDocument of syncedDocuments . values ( ) ) {
900
900
if ( computeValidate ( textDocument ) === Validate . off ) {
901
901
syncedDocuments . delete ( textDocument . uri . toString ( ) ) ;
902
+ await client . onReady ( ) ;
902
903
client . sendNotification ( DidCloseTextDocumentNotification . type , client . code2ProtocolConverter . asCloseTextDocumentParams ( textDocument ) ) ;
903
904
}
904
905
}
905
906
for ( const textDocument of Workspace . textDocuments ) {
906
907
if ( ! syncedDocuments . has ( textDocument . uri . toString ( ) ) && computeValidate ( textDocument ) !== Validate . off ) {
908
+ await client . onReady ( ) ;
907
909
client . sendNotification ( DidOpenTextDocumentNotification . type , client . code2ProtocolConverter . asOpenTextDocumentParams ( textDocument ) ) ;
908
910
syncedDocuments . set ( textDocument . uri . toString ( ) , textDocument ) ;
909
911
}
@@ -1350,7 +1352,7 @@ function realActivate(context: ExtensionContext): void {
1350
1352
1351
1353
context . subscriptions . push (
1352
1354
client . start ( ) ,
1353
- Commands . registerCommand ( 'eslint.executeAutofix' , ( ) => {
1355
+ Commands . registerCommand ( 'eslint.executeAutofix' , async ( ) => {
1354
1356
const textEditor = Window . activeTextEditor ;
1355
1357
if ( ! textEditor ) {
1356
1358
return ;
@@ -1363,6 +1365,7 @@ function realActivate(context: ExtensionContext): void {
1363
1365
command : 'eslint.applyAllFixes' ,
1364
1366
arguments : [ textDocument ]
1365
1367
} ;
1368
+ await client . onReady ( ) ;
1366
1369
client . sendRequest ( ExecuteCommandRequest . type , params ) . then ( undefined , ( ) => {
1367
1370
Window . showErrorMessage ( 'Failed to apply ESLint fixes to the document. Please consider opening an issue with steps to reproduce.' ) ;
1368
1371
} ) ;
0 commit comments