diff --git a/ChangeLog.md b/ChangeLog.md index d4be0aa92f..2b95c4a5c1 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fix analyzer [RCS1172](https://josefpihrt.github.io/docs/roslynator/analyzers/RCS1172) ([PR](https://github.com/dotnet/roslynator/pull/1710)) +- [CLI] Fix `loc` command ([PR](https://github.com/dotnet/roslynator/pull/1711)) ## [4.14.1] - 2025-10-05 diff --git a/src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpLinesWalker.cs b/src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpLinesWalker.cs index ad60f4bc2b..1fa35eda35 100644 --- a/src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpLinesWalker.cs +++ b/src/CSharp.Workspaces/CSharp/CodeMetrics/CSharpLinesWalker.cs @@ -70,7 +70,7 @@ public override void VisitTrivia(SyntaxTrivia trivia) int lineCount = Lines.GetLineCount(trivia.Span); if (lineCount == 1 - || line.IsEmptyOrWhiteSpace(TextSpan.FromBounds(Lines.GetLineFromPosition(span.End).End, span.End))) + || line.IsEmptyOrWhiteSpace(TextSpan.FromBounds(span.End, Lines.GetLineFromPosition(span.End).End))) { CommentLineCount += lineCount; }