Skip to content
This repository was archived by the owner on Jul 15, 2023. It is now read-only.

Commit f7245ce

Browse files
Merge pull request #121 from sharwell/fix-119
Improve identification of relevant nodes for QuickInfo in Roslyn
2 parents bf87941 + efea728 commit f7245ce

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Microsoft.Research/ContractAdornments/CSharp.Roslyn/Intellisense/IntellisenseContractsHelper.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,18 @@ public static SyntaxNode GetTargetAtTriggerPoint(ITrackingPoint triggerPoint, IT
141141
if (asCall != null) {
142142

143143
//Make sure we aren't on the right side of the call
144+
if (asCall.Expression == leafNode)
145+
return asCall;
146+
144147
MemberAccessExpressionSyntax memberAccessExpression = asCall.Expression as MemberAccessExpressionSyntax;
145-
if (memberAccessExpression == null || memberAccessExpression.Name == leafNode)
146-
return null;
148+
if (memberAccessExpression != null && memberAccessExpression.Name == leafNode)
149+
return asCall;
147150

148-
return asCall;
151+
GenericNameSyntax genericNameSyntax = asCall.Expression as GenericNameSyntax;
152+
if (genericNameSyntax != null && genericNameSyntax.Identifier == leafToken)
153+
return asCall;
154+
155+
return null;
149156
}
150157

151158
var asProp = nodeInQuestion as MemberAccessExpressionSyntax;

0 commit comments

Comments
 (0)