diff --git a/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionContributor.java b/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionContributor.java index 1b3ac51b9cca..b15b9575ea1b 100644 --- a/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionContributor.java +++ b/platform/lang-api/src/com/intellij/codeInsight/completion/CompletionContributor.java @@ -190,11 +190,20 @@ public abstract class CompletionContributor { /** * Allow autoPopup to appear after custom symbol + * @deprecated use {@link CompletionContributor#invokeAutoPopup(PsiElement, char, int)} */ + @Deprecated public boolean invokeAutoPopup(@NotNull PsiElement position, char typeChar) { return false; } + /** + * Allow autoPopup to appear after custom symbol + */ + public boolean invokeAutoPopup(@NotNull PsiElement position, char typeChar, int offset) { + return invokeAutoPopup(position, typeChar); + } + /** * Invoked in a read action in parallel to the completion process. Used to calculate the replacement offset * (see {@link CompletionInitializationContext#setReplacementOffset(int)}) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TypedHandler.java b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TypedHandler.java index 90a16444bc3a..fe2823b72892 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TypedHandler.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/editorActions/TypedHandler.java @@ -289,7 +289,7 @@ public class TypedHandler extends TypedActionHandlerBase { final PsiElement element = file.findElementAt(offset); if (element != null) { for (CompletionContributor contributor : CompletionContributor.forLanguageHonorDumbness(element.getLanguage(), file.getProject())) { - if (contributor.invokeAutoPopup(element, charTyped)) { + if (contributor.invokeAutoPopup(element, charTyped, offset + 1)) { LOG.debug(contributor + " requested completion autopopup when typing '" + charTyped + "'"); return true; }