Skip to content

Commit 44fd5d6

Browse files
committed
Fix SA1009 behavior inside trivia
Fixes #1834
1 parent 7e6dfe9 commit 44fd5d6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

StyleCop.Analyzers/StyleCop.Analyzers/SpacingRules/SA1009ClosingParenthesisMustBeSpacedCorrectly.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ private static void HandleCompilationStart(CompilationStartAnalysisContext conte
6363
private static void HandleSyntaxTree(SyntaxTreeAnalysisContext context)
6464
{
6565
SyntaxNode root = context.Tree.GetCompilationUnitRoot(context.CancellationToken);
66-
foreach (var token in root.DescendantTokens())
66+
foreach (var token in root.DescendantTokens(descendIntoTrivia: true))
6767
{
6868
if (token.IsKind(SyntaxKind.CloseParenToken))
6969
{
@@ -96,6 +96,7 @@ private static void HandleCloseParenToken(SyntaxTreeAnalysisContext context, Syn
9696
case SyntaxKind.CloseBracketToken:
9797
case SyntaxKind.SemicolonToken:
9898
case SyntaxKind.CommaToken:
99+
case SyntaxKind.DoubleQuoteToken:
99100
precedesStickyCharacter = true;
100101
break;
101102

0 commit comments

Comments
 (0)