Skip to content

Commit 842d46c

Browse files
Copilotbergmeister
andauthored
Include line continuations in comment scan
Co-authored-by: bergmeister <9250262+bergmeister@users.noreply.github.com>
1 parent fa021dd commit 842d46c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎Rules/UseConsistentIndentation.cs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,8 @@ private static int GetCommentRunIndentationOffset(
381381
int leastIndentedColumn = tokens[firstCommentIndex].Extent.StartColumnNumber;
382382
for (int nextCommentIndex = firstCommentIndex + 2;
383383
nextCommentIndex < tokens.Length &&
384-
tokens[nextCommentIndex - 1].Kind == TokenKind.NewLine &&
384+
(tokens[nextCommentIndex - 1].Kind == TokenKind.NewLine ||
385+
tokens[nextCommentIndex - 1].Kind == TokenKind.LineContinuation) &&
385386
tokens[nextCommentIndex].Kind == TokenKind.Comment &&
386387
tokens[nextCommentIndex].Extent.StartLineNumber == tokens[nextCommentIndex - 2].Extent.EndLineNumber + 1;
387388
nextCommentIndex += 2)

0 commit comments

Comments
 (0)