mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 06:05:01 +07:00
IDEA-58766 Recognize dot as completion prefix part for chained call suggestions, groovy
This commit is contained in:
@@ -65,7 +65,11 @@ public class JavaChainLookupElement extends LookupElementDecorator<LookupElement
|
||||
}
|
||||
|
||||
private String maybeAddParentheses(String s) {
|
||||
return myQualifier.getObject() instanceof PsiMethod ? s + "()" : s;
|
||||
Object qObject = myQualifier.getObject();
|
||||
if (qObject instanceof ResolveResult) {
|
||||
qObject = ((ResolveResult)qObject).getElement();
|
||||
}
|
||||
return qObject instanceof PsiMethod ? s + "()" : s;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -99,7 +103,7 @@ public class JavaChainLookupElement extends LookupElementDecorator<LookupElement
|
||||
CompletionUtil.emulateInsertion(getDelegate(), context.getTailOffset(), context);
|
||||
}
|
||||
|
||||
private static boolean shouldParenthesizeQualifier(final PsiFile file, final int startOffset, final int endOffset) {
|
||||
protected boolean shouldParenthesizeQualifier(final PsiFile file, final int startOffset, final int endOffset) {
|
||||
PsiElement element = file.findElementAt(startOffset);
|
||||
if (element == null) {
|
||||
return false;
|
||||
|
||||
@@ -346,6 +346,9 @@ public class JavaCompletionUtil {
|
||||
|
||||
@Nullable
|
||||
private static PsiType getPsiType(final Object o) {
|
||||
if (o instanceof ResolveResult) {
|
||||
return getPsiType(((ResolveResult)o).getElement());
|
||||
}
|
||||
if (o instanceof PsiVariable) {
|
||||
return ((PsiVariable)o).getType();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user