void (IntentionAction intention, Editor editor) { IntentionAction unwrapped = IntentionActionDelegate.unwrap(intention); // Suppress actions are under submenu, no preview is generated for them anyway if (unwrapped instanceof SuppressIntentionAction) return; IntentionPreviewInfo previewInfo; try { // Should not require EDT or write-action previewInfo = ApplicationManager.getApplication().executeOnPooledThread( () -> ReadAction.compute( () -> IntentionPreviewPopupUpdateProcessor.getPreviewInfo(getProject(), intention, getFile(), editor)) ).get(); } catch (Exception e) { throw new RuntimeException( "Intention action " + MadTestingUtil.getIntentionDescription(intention) + " fails during preview", e); } if (previewInfo == null || previewInfo == IntentionPreviewInfo.EMPTY || previewInfo == IntentionPreviewInfo.FALLBACK_DIFF) { throw new RuntimeException( "Intention action " + MadTestingUtil.getIntentionDescription(intention) + " is not preview-friendly"); } // TODO: check that preview text is the same as actual text // may require explicit formatting }