void () { myDaemonCodeAnalyzer.serializeCodeInsightPasses(true); // reproduced only for serialized passes try { Collection<Editor> applied = ContainerUtil.createEmptyCOWList(); Collection<Editor> collected = ContainerUtil.createEmptyCOWList(); registerFakePass(applied, collected); @Language("JAVA") String text = "class X {" + "\n".repeat(1000) + "}"; configureByText(JavaFileType.INSTANCE, text); Editor editor1 = getEditor(); Editor editor2 = EditorFactory.getInstance().createEditor(editor1.getDocument(),getProject()); Disposer.register(getProject(), () -> EditorFactory.getInstance().releaseEditor(editor2)); TextEditor textEditor1 = new PsiAwareTextEditorProvider().getTextEditor(editor1); TextEditor textEditor2 = new PsiAwareTextEditorProvider().getTextEditor(editor2); setActiveEditors(editor1, editor2); myDaemonCodeAnalyzer.runPasses(myFile, editor1.getDocument(), textEditor1, new int[0], false, null); myDaemonCodeAnalyzer.runPasses(myFile, editor1.getDocument(), textEditor2, new int[0], false, null); assertSameElements(collected, Arrays.asList(editor1, editor2)); assertSameElements(applied, Arrays.asList(editor1, editor2)); applied.clear(); collected.clear(); setActiveEditors(editor1, editor2); type("/* xxx */"); waitForDaemon(); assertSameElements(collected, Arrays.asList(editor1, editor2)); assertSameElements(applied, Arrays.asList(editor1, editor2)); } finally { myDaemonCodeAnalyzer.serializeCodeInsightPasses(false); } }