Skip to content

Commit

Permalink
- Fixed incorrectly implemented GetFollowingDirective
Browse files Browse the repository at this point in the history
  • Loading branch information
wmjordan committed Apr 17, 2023
1 parent 06d47d5 commit 436a572
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Codist/Helpers/CodeAnalysisHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -970,13 +970,13 @@ public static TEndDirective GetFollowingDirective<TStartDirective, TEndDirective
DirectiveTriviaSyntax d = directive;
int c = 1;
while ((d = d.GetNextDirective()) != null) {
if (d.IsKind(SyntaxKind.EndRegionDirectiveTrivia)) {
if (d.IsKind(endSyntaxKind)) {
--c;
if (c == 0) {
return d as TEndDirective;
}
}
else if (d.IsKind(SyntaxKind.RegionDirectiveTrivia)) {
else if (d.IsKind(startSyntaxKind)) {
++c;
}
}
Expand Down

0 comments on commit 436a572

Please sign in to comment.