void () { final int oldModificationStamp = myModificationStamp; asyncCheckErrors(myChangedFiles, errorsFound -> { if (myDisposable == null) { return; } if (myModificationStamp != oldModificationStamp) { // 'documentChanged' event was raised during async checking files for errors // Do nothing in that case, this method will be invoked subsequently. return; } LookupEx activeLookup = LookupManager.getInstance(myProject).getActiveLookup(); if (activeLookup != null && activeLookup.isCompletion()) { // This method will be invoked when the completion popup is hidden. return; } if (errorsFound) { // Do nothing, if some changed file has syntax errors. // This method will be invoked subsequently, when syntax errors are fixed. return; } myChangedFiles.clear(); if (myModificationStampConsumer != null) { myModificationStampConsumer.accept(myModificationStamp); } else { int initialModificationStamp = myModificationStamp; Objects.requireNonNull(myAutoTestManager).restartAllAutoTests(() -> { return myModificationStamp == initialModificationStamp; }); } }); }