import com.intellij.codeInsight.daemon.DaemonCodeAnalyzer;
import com.intellij.codeInsight.daemon.impl.DaemonCodeAnalyzerImpl;
import com.intellij.codeInsight.daemon.impl.ShowIntentionsPass;
+import com.intellij.codeInsight.hint.HintManagerImpl;
import com.intellij.codeInsight.intention.IntentionAction;
import com.intellij.codeInsight.intention.PsiElementBaseIntentionAction;
import com.intellij.codeInsight.template.impl.TemplateManagerImpl;
public void invoke(@NotNull final Project project, @NotNull final Editor editor, @NotNull final PsiFile file) {
PsiDocumentManager.getInstance(project).commitAllDocuments();
+ if (HintManagerImpl.getInstanceImpl().performCurrentQuestionAction()) return;
+
//intentions check isWritable before modification: if (!file.isWritable()) return;
if (file instanceof PsiCodeFragment) return;
};
}
+ public boolean performCurrentQuestionAction() {
+ if (myQuestionAction != null && myQuestionHint != null) {
+ if (myQuestionHint.isVisible()) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("performing an action:" + myQuestionAction);
+ }
+ if (myQuestionAction.execute()) {
+ if (myQuestionHint != null) {
+ myQuestionHint.hide();
+ }
+ }
+ return true;
+ }
+
+ myQuestionAction = null;
+ myQuestionHint = null;
+ }
+
+ return false;
+ }
+
+
private void updateScrollableHints(VisibleAreaEvent e) {
LOG.assertTrue(SwingUtilities.isEventDispatchThread());
for (HintInfo info : myHintsStack) {