use of com.intellij.psi.impl.source.tree.java.PsiExpressionListImpl in project intellij-community by JetBrains.
the class JavaResolveUtil method resolveImaginarySuperCallInThisPlace.
/**
* @return the constructor (or a class if there are none)
* which the "{@code super();}" no-args call resolves to if inserted in the {@code place} (typically it would be inserted in the sub class constructor)
* No code modifications happen in this method; it's used for resolving multiple overloaded constructors.
*/
public static PsiElement resolveImaginarySuperCallInThisPlace(@NotNull PsiMember place, @NotNull Project project, @NotNull PsiClass superClassWhichTheSuperCallMustResolveTo) {
PsiExpressionListImpl expressionList = new PsiExpressionListImpl();
final DummyHolder result = DummyHolderFactory.createHolder(PsiManager.getInstance(project), place);
final FileElement holder = result.getTreeElement();
holder.rawAddChildren((TreeElement) expressionList.getNode());
return PsiResolveHelper.SERVICE.getInstance(project).resolveConstructor(PsiTypesUtil.getClassType(superClassWhichTheSuperCallMustResolveTo), expressionList, place).getElement();
}
Aggregations