@@ -420,7 +420,8 @@ private Declaration ResolveType(Declaration parent)
420
420
. ToList ( ) ;
421
421
}
422
422
423
- return result . Count == 1 ? result . SingleOrDefault ( ) : null ;
423
+ return result . Count == 1 ? result . SingleOrDefault ( ) :
424
+ matches . Count == 1 ? matches . First ( ) : null ;
424
425
}
425
426
426
427
private static readonly Type [ ] IdentifierContexts =
@@ -803,6 +804,8 @@ public void Resolve(VBAParser.ICS_S_MembersCallContext context)
803
804
804
805
if ( parent == null )
805
806
{
807
+
808
+
806
809
return ;
807
810
}
808
811
@@ -826,7 +829,7 @@ public void Resolve(VBAParser.ICS_S_MembersCallContext context)
826
829
return ;
827
830
}
828
831
829
- member . AddMemberCall ( CreateReference ( GetMemberCallIdentifierContext ( memberCall ) , member ) ) ;
832
+ member . AddReference ( CreateReference ( GetMemberCallIdentifierContext ( memberCall ) , member ) ) ;
830
833
parent = ResolveType ( member ) ;
831
834
}
832
835
@@ -1173,7 +1176,8 @@ private static bool IsBuiltInDeclarationInScope(Declaration item, Declaration lo
1173
1176
// if localScope is not null, we can resolve to any public or global in that scope:
1174
1177
var isInLocalScope = ( localScope != null && item . Accessibility == Accessibility . Global
1175
1178
&& localScope . IdentifierName == item . ParentDeclaration . IdentifierName )
1176
- || ( localScope != null && localScope . QualifiedName . QualifiedModuleName . Component . Type == Microsoft . Vbe . Interop . vbext_ComponentType . vbext_ct_Document
1179
+ || ( localScope != null && localScope . QualifiedName . QualifiedModuleName . Component != null
1180
+ && localScope . QualifiedName . QualifiedModuleName . Component . Type == Microsoft . Vbe . Interop . vbext_ComponentType . vbext_ct_Document
1177
1181
&& item . Accessibility == Accessibility . Public && item . ParentDeclaration . DeclarationType == localScope . DeclarationType ) ;
1178
1182
1179
1183
return isBuiltInNonEvent && ( isBuiltInGlobal || isInLocalScope ) ;
0 commit comments