* Lookup routines *
* *******************************************************
*/
public BasePsiElement lookupPsiElement(PsiLookupAdapter lookupAdapter, int scopeCrossCount) {
if (lookupAdapter instanceof IdentifierLookupAdapter) {
IdentifierLookupAdapter identifierLookupAdapter = (IdentifierLookupAdapter) lookupAdapter;
if (identifierLookupAdapter.matchesName(this)) {
PsiElement parentPsiElement = getParent();
if (parentPsiElement instanceof QualifiedIdentifierPsiElement) {
QualifiedIdentifierPsiElement qualifiedIdentifierPsiElement = (QualifiedIdentifierPsiElement) parentPsiElement;
QualifiedIdentifierElementType qualifiedIdentifierElementType = qualifiedIdentifierPsiElement.getElementType();
if (!qualifiedIdentifierElementType.containsObjectType(identifierLookupAdapter.getObjectType())) {
return null;
}
}
return lookupAdapter.matches(this) ? this : null;
}