void () { Disposable resolveInBackground = Disposer.newDisposable(); ((UnresolvedReferenceQuickFixUpdaterImpl)UnresolvedReferenceQuickFixUpdater.getInstance(getProject())).stopUntil(resolveInBackground); ExtensionPointName.create("com.intellij.codeInsight.unresolvedReferenceQuickFixProvider").getPoint().registerExtension(new MyVerySlowQuickFixProvider(), getTestRootDisposable()); int N = 1000; String unresolvedDeclarations = IntStream.range(0, N).mapToObj(i-> "public UnknownClassNumber" + i + " var" + i + ";\n").collect(Collectors.joining()); @Language("JAVA") String text = """ package x; class X { """ + unresolvedDeclarations + """ } """; ALLOW_UNRESOLVED_REFERENCE_QUICK_FIXES = false; regFixCalled.clear(); configureFromFileText("X.java", text); List<HighlightInfo> errors = highlightErrors(); assertSize(N, errors); assertEmpty(StringUtil.join(regFixCalled, t-> ExceptionUtil.getThrowableText(t), "\n----\n"), regFixCalled); Disposer.dispose(resolveInBackground); regFixCalled.clear(); getEditor().getCaretModel().moveToOffset(getEditor().getDocument().getText().indexOf("UnknownClassNumber15")); ALLOW_UNRESOLVED_REFERENCE_QUICK_FIXES = true; DaemonCodeAnalyzer.getInstance(getProject()).restart(); errors = highlightErrors(); CodeInsightTestFixtureImpl.waitForUnresolvedReferencesQuickFixesUnderCaret(getFile(), getEditor()); UIUtil.dispatchAllInvocationEvents(); assertSize(N, errors); assertNotEmpty(regFixCalled); }