use of org.jetbrains.plugins.groovy.lang.psi.typeEnhancers.GrReferenceTypeEnhancer in project intellij-community by JetBrains.
the class GrReferenceExpressionImpl method getNominalType.
@Nullable
private PsiType getNominalType(boolean forceRValue) {
final GroovyResolveResult resolveResult = PsiImplUtil.extractUniqueResult(multiResolve(false, forceRValue));
PsiElement resolved = resolveResult.getElement();
for (GrReferenceTypeEnhancer enhancer : GrReferenceTypeEnhancer.EP_NAME.getExtensions()) {
PsiType type = enhancer.getReferenceType(this, resolved);
if (type != null) {
return type;
}
}
IElementType dotType = getDotTokenType();
if (dotType == GroovyTokenTypes.mMEMBER_POINTER) {
return GrClosureType.create(multiResolve(false), this);
}
if (ResolveUtil.isDefinitelyKeyOfMap(this)) {
final PsiType type = getTypeFromMapAccess(this);
if (type != null) {
return type;
}
}
PsiType result = getNominalTypeInner(resolved);
if (result == null)
return null;
result = TypesUtil.substituteAndNormalizeType(result, resolveResult.getSubstitutor(), resolveResult.getSpreadState(), this);
return result;
}
Aggregations