Skip to content

Commit a7569f2

Browse files
SemanticTokensVisitor: _range field doesn't need to be nullable
1 parent c2c9d22 commit a7569f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Razor/src/Microsoft.CodeAnalysis.Razor.Workspaces/SemanticTokens/SemanticTokensVisitor.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ internal sealed class SemanticTokensVisitor : SyntaxWalker
1616
{
1717
private readonly ImmutableArray<SemanticRange>.Builder _semanticRanges;
1818
private readonly RazorCodeDocument _razorCodeDocument;
19-
private readonly TextSpan? _range;
19+
private readonly TextSpan _range;
2020
private readonly ISemanticTokensLegendService _semanticTokensLegend;
2121
private readonly bool _colorCodeBackground;
2222

2323
private bool _addRazorCodeModifier;
2424

25-
private SemanticTokensVisitor(ImmutableArray<SemanticRange>.Builder semanticRanges, RazorCodeDocument razorCodeDocument, TextSpan? range, ISemanticTokensLegendService semanticTokensLegend, bool colorCodeBackground)
25+
private SemanticTokensVisitor(ImmutableArray<SemanticRange>.Builder semanticRanges, RazorCodeDocument razorCodeDocument, TextSpan range, ISemanticTokensLegendService semanticTokensLegend, bool colorCodeBackground)
2626
{
2727
_semanticRanges = semanticRanges;
2828
_razorCodeDocument = razorCodeDocument;
@@ -52,7 +52,7 @@ private void Visit(SyntaxList<RazorSyntaxNode> syntaxNodes)
5252

5353
private bool IsInRange(TextSpan span)
5454
{
55-
return _range is TextSpan range && range.OverlapsWith(span);
55+
return _range.OverlapsWith(span);
5656
}
5757

5858
public override void Visit(SyntaxNode? node)

0 commit comments

Comments
 (0)