Skip to content

Commit 97f3be3

Browse files
committed
_Application members resolve and tests pass
1 parent 648a704 commit 97f3be3

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

Rubberduck.Parsing/Symbols/IdentifierReferenceResolver.cs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,13 @@ private Declaration ResolveType(Declaration parent)
366366
? parent.AsTypeName.Split('.').Last() // bug: this can't be right
367367
: parent.AsTypeName;
368368

369-
var matches = _declarationFinder.MatchName(identifier).ToList();
369+
identifier = identifier.StartsWith("VT_") ? parent.IdentifierName : identifier;
370+
371+
var matches = _declarationFinder.MatchTypeName(identifier).ToList();
372+
if (matches.Count == 1)
373+
{
374+
return matches.Single();
375+
}
370376

371377
var result = matches.Where(item =>
372378
(item.DeclarationType == DeclarationType.UserDefinedType
@@ -1080,8 +1086,8 @@ private Declaration FindModuleScopeProcedure(string identifierName, Declaration
10801086

10811087
var matches = _declarationFinder.MatchName(identifierName);
10821088
var result = matches.Where(item =>
1083-
item.Project == localScope.Project
1084-
&& item.ComponentName == localScope.ComponentName
1089+
localScope.ProjectName == item.ProjectName
1090+
&& (localScope.ComponentName.Replace("_", string.Empty) == item.ComponentName.Replace("_", string.Empty))
10851091
&& (IsProcedure(item, localScope) || IsPropertyAccessor(item, accessorType, localScope, isAssignmentTarget)))
10861092
.ToList();
10871093

0 commit comments

Comments
 (0)