Skip to content

Commit

Permalink
Skip incomplete member (#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
josefpihrt committed Feb 7, 2024
1 parent 27985f4 commit 0ff1340
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private static void Analyze(SyntaxNodeAnalysisContext context, SyntaxList<Member
CancellationToken cancellationToken = context.CancellationToken;
MemberDeclarationSyntax member;
MemberDeclarationSyntax previousMember = members[0];
bool isPreviousGlobalStatement = previousMember.IsKind(SyntaxKind.GlobalStatement);
bool isPreviousSkippable = previousMember.IsKind(SyntaxKind.GlobalStatement, SyntaxKind.IncompleteMember);
bool? isSingleLine;
bool? isPreviousSingleLine = null;

Expand All @@ -94,11 +94,11 @@ private static void Analyze(SyntaxNodeAnalysisContext context, SyntaxList<Member
member = members[i];
isSingleLine = null;

bool isGlobalStatement = member.IsKind(SyntaxKind.GlobalStatement);
bool areGlobalStatements = isPreviousGlobalStatement && isGlobalStatement;
isPreviousGlobalStatement = isGlobalStatement;
bool isSkippable = member.IsKind(SyntaxKind.GlobalStatement, SyntaxKind.IncompleteMember);
bool areSkippable = isPreviousSkippable && isSkippable;
isPreviousSkippable = isSkippable;

if (areGlobalStatements)
if (areSkippable)
continue;

TriviaBlock block = TriviaBlock.FromBetween(previousMember, member);
Expand Down

0 comments on commit 0ff1340

Please sign in to comment.