void () { configureByText(JavaFileType.INSTANCE, "class X { <caret> }"); StoreUtilKt.runInAllowSaveMode(true, () -> { StoreUtil.saveDocumentsAndProjectsAndApp(true); VirtualFile workspaceFile = Objects.requireNonNull(getProject().getWorkspaceFile()); PsiFile excluded = Objects.requireNonNull(PsiManager.getInstance(getProject()).findFile(workspaceFile)); assertEmpty(highlightErrors()); FileStatusMap me = DaemonCodeAnalyzerEx.getInstanceEx(getProject()).getFileStatusMap(); TextRange scope = me.getFileDirtyScope(getEditor().getDocument(), getFile(), Pass.UPDATE_ALL); assertNull(scope); WriteCommandAction.runWriteCommandAction(getProject(), () -> { Document document = Objects.requireNonNull(PsiDocumentManager.getInstance(getProject()).getDocument(excluded)); document.insertString(0, "<!-- dsfsd -->"); PsiDocumentManager.getInstance(getProject()).commitAllDocuments(); }); UIUtil.dispatchAllInvocationEvents(); scope = me.getFileDirtyScope(getEditor().getDocument(), getFile(), Pass.UPDATE_ALL); assertNull(scope); return Unit.INSTANCE; }); }