Skip to content

Commit 1b2bab7

Browse files
Filter out inline hint spans out of hte bounds of hte span we are querying for
1 parent 7edae94 commit 1b2bab7

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/Features/Core/Portable/InlineHints/AbstractInlineParameterNameHintsService.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ void AddHintsIfAppropriate(SyntaxNode node)
8484

8585
foreach (var (position, argument, parameter, kind) in buffer)
8686
{
87+
// We get hints on *nodes* that intersect the passed in text span. However, while the full node may
88+
// intersect the span, the positions of the all the sub-nodes in it that we make hints for (like the
89+
// positions of the arguments in an invocation) may not. So, filter out any hints that aren't actually
90+
// in the span we care about here.
91+
if (textSpan.IntersectsWith(position))
92+
continue;
93+
8794
if (string.IsNullOrEmpty(parameter?.Name))
8895
continue;
8996

0 commit comments

Comments
 (0)