Skip to content

Commit 3b0345c

Browse files
committed
closes #2805
1 parent 639e07f commit 3b0345c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Rubberduck.Parsing/VBA/RubberduckParserState.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,15 @@ public Declaration FindSelectedDeclaration(ICodePane activeCodePane, bool proced
10691069
item.DeclarationType == DeclarationType.ProceduralModule) &&
10701070
item.QualifiedName.QualifiedModuleName.Equals(selection.Value.QualifiedName))
10711071
{
1072-
match = match != null ? null : item;
1072+
var procName = activeCodePane.CodeModule.GetProcOfLine(selection.Value.Selection.StartLine);
1073+
if (!string.IsNullOrEmpty(procName))
1074+
{
1075+
match = DeclarationFinder.Members(item).SingleOrDefault(m => m.IdentifierName == procName);
1076+
}
1077+
else
1078+
{
1079+
match = match != null ? null : item;
1080+
}
10731081
}
10741082
}
10751083
}

0 commit comments

Comments
 (0)