void () { Map<ProgressIndicator, Throwable> isAvailableCalled = new ConcurrentHashMap<>(); IntentionAction action = new AbstractIntentionAction() { @Nls(capitalization = Nls.Capitalization.Sentence) @NotNull @Override public String getText() { return "My"; } @Override public boolean isAvailable(@NotNull Project project, Editor editor, PsiFile file) { DaemonProgressIndicator indicator = (DaemonProgressIndicator)ProgressIndicatorProvider.getGlobalProgressIndicator(); Throwable alreadyCalled = isAvailableCalled.put(indicator, new Throwable()); if (alreadyCalled != null) { throw new IllegalStateException(" .isAvailable() already called in:\n---------------\n"+ExceptionUtil.getThrowableText(alreadyCalled)+"\n-----------"); } return true; } @Override public void invoke(@NotNull Project project, Editor editor, PsiFile file) throws IncorrectOperationException { } }; IntentionManager.getInstance().addAction(action); Disposer.register(getTestRootDisposable(), () -> IntentionManager.getInstance().unregisterIntention(action)); @Language("JAVA") String text = "class X { }"; configureByText(JavaFileType.INSTANCE, text); WriteCommandAction.runWriteCommandAction(getProject(), () -> myEditor.getDocument().setText(text)); doHighlighting(); myDaemonCodeAnalyzer.restart(); doHighlighting(); }