show autopopup after completing a package when and only when there was a dot inserted after the previous package

This commit is contained in:
peter
2012-02-10 15:03:51 +01:00
parent cb0442de53
commit fbf99fd29b
2 changed files with 4 additions and 2 deletions
@@ -60,7 +60,7 @@ public class JavaTypedHandler extends TypedHandlerDelegate {
}
//do not show lookup when typing varargs ellipsis
final PsiElement prevSibling = lastElement.getPrevSibling();
final PsiElement prevSibling = PsiTreeUtil.prevVisibleLeaf(lastElement);
if (prevSibling == null || ".".equals(prevSibling.getText())) return false;
PsiElement parent = prevSibling;
do {
@@ -33,6 +33,8 @@ class PackageLookupItem extends LookupItem<PsiPackage> {
@Override
public void handleInsert(InsertionContext context) {
super.handleInsert(context);
AutoPopupController.getInstance(context.getProject()).scheduleAutoPopup(context.getEditor(), null);
if (getTailType() == TailType.DOT || context.getCompletionChar() == '.') {
AutoPopupController.getInstance(context.getProject()).scheduleAutoPopup(context.getEditor(), null);
}
}
}