From cbfc524435a6ae00babb110f655608f65319fb26 Mon Sep 17 00:00:00 2001 From: Sergey Ignatov Date: Wed, 25 Jun 2014 16:02:21 +0400 Subject: [PATCH] better where/from completion (DBE-225) --- .../completion/AddSpaceInsertHandler.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/completion/AddSpaceInsertHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/completion/AddSpaceInsertHandler.java index d0e990654f3d..d3cfedaf6a1a 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/completion/AddSpaceInsertHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/completion/AddSpaceInsertHandler.java @@ -1,5 +1,6 @@ package com.intellij.codeInsight.completion; +import com.intellij.codeInsight.AutoPopupController; import com.intellij.codeInsight.lookup.LookupElement; import com.intellij.openapi.editor.Document; import com.intellij.openapi.editor.Editor; @@ -11,7 +12,14 @@ import com.intellij.psi.PsiDocumentManager; * @author zolotov */ public class AddSpaceInsertHandler implements InsertHandler { - public final static InsertHandler INSTANCE = new AddSpaceInsertHandler(); + public final static InsertHandler INSTANCE = new AddSpaceInsertHandler(false); + public final static InsertHandler INSTANCE_WITH_AUTO_POPUP = new AddSpaceInsertHandler(true); + + private final boolean myTriggerAutoPopup; + + public AddSpaceInsertHandler(boolean triggerAutoPopup) { + myTriggerAutoPopup = triggerAutoPopup; + } public void handleInsert(InsertionContext context, LookupElement item) { Editor editor = context.getEditor(); @@ -25,6 +33,9 @@ public class AddSpaceInsertHandler implements InsertHandler { else { editor.getCaretModel().moveToOffset(editor.getCaretModel().getOffset() + 1); } + if (myTriggerAutoPopup) { + AutoPopupController.getInstance(project).autoPopupMemberLookup(editor, null); + } } }