From 3db2f536e78353b7c7fae6af87caa10657e14ef6 Mon Sep 17 00:00:00 2001 From: Eugene Vigdorchik Date: Mon, 21 Feb 2005 15:48:02 +0300 Subject: [PATCH] (no message) --- .../intellij/codeInsight/daemon/impl/ShowIntentionsPass.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java b/source/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java index 1298bb9177c0..7465e0634025 100644 --- a/source/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java +++ b/source/com/intellij/codeInsight/daemon/impl/ShowIntentionsPass.java @@ -244,7 +244,6 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass { */ public static boolean showAddImportHint(Editor editor, final PsiJavaCodeReferenceElement ref) { if (HintManager.getInstance().hasShownHintsThatWillHideByOtherHint()) return false; - if (isCaretNearRef(editor,ref)) return false; PsiManager manager = ref.getManager(); if (manager == null) return false; @@ -315,7 +314,7 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass { int offset2 = ref.getTextRange().getEndOffset(); QuestionAction action = new AddImportAction(manager.getProject(), ref, classes, editor); - if (classes.length == 1 && CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY) { + if (classes.length == 1 && CodeInsightSettings.getInstance().ADD_UNAMBIGIOUS_IMPORTS_ON_THE_FLY && !isCaretNearRef(editor,ref)) { action.execute(); return false; } @@ -334,4 +333,4 @@ public class ShowIntentionsPass extends TextEditorHighlightingPass { private static boolean canBeHint(HighlightInfoType type) { return type == HighlightInfoType.WRONG_REF || type == HighlightInfoType.JAVADOC_WRONG_REF; } -} \ No newline at end of file +}