Skip to content

Commit

Permalink
Fix #90
Browse files Browse the repository at this point in the history
  • Loading branch information
Rekkonnect committed Dec 15, 2024
1 parent 1229796 commit 891f0b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -947,8 +947,12 @@ private static string EndOfLineTriviaText(SyntaxTrivia trivia)

private static string DisabledTextTriviaText(SyntaxTrivia trivia)
{
// https://github.com/dotnet/roslyn/issues/76441
if (trivia.SyntaxTree is null)
return "[Unknown line bounds]";

var span = trivia.Span;
var lineSpan = trivia.SyntaxTree!.GetLineSpan(span).Span;
var lineSpan = trivia.SyntaxTree.GetLineSpan(span).Span;
int startLine = lineSpan.Start.Line + 1;
int endLine = lineSpan.End.Line + 1;
if (lineSpan.End.Character is 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -953,8 +953,12 @@ private static string EndOfLineTriviaText(SyntaxTrivia trivia)

private static string DisabledTextTriviaText(SyntaxTrivia trivia)
{
// https://github.com/dotnet/roslyn/issues/76441
if (trivia.SyntaxTree is null)
return "[Unknown line bounds]";

var span = trivia.Span;
var lineSpan = trivia.SyntaxTree!.GetLineSpan(span).Span;
var lineSpan = trivia.SyntaxTree.GetLineSpan(span).Span;
int startLine = lineSpan.Start.Line + 1;
int endLine = lineSpan.End.Line + 1;
if (lineSpan.End.Character is 0)
Expand Down

0 comments on commit 891f0b7

Please sign in to comment.