Skip to content

Commit

Permalink
skip block comments in FLOW OF CONTROL de-indent
Browse files Browse the repository at this point in the history
  • Loading branch information
kyklish committed Nov 14, 2022
1 parent 05446cc commit 3249f8c
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/providers/formattingProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -629,13 +629,15 @@ export const internalFormat = (

// FLOW OF CONTROL de-indent from all nesting
// if (a > 0
// and b > 0) <-- skip continuation section
// code <-- skip one command code
// and b > 0) <-- skip continuation section
// code <-- skip one command code
// /* block comment */ <-- skip block comment
// code <-- de-indent
if (
!oneCommandCode &&
(ifDepth.last() > -1 || focDepth.last() > -1) &&
!continuationSectionExpression &&
(ifDepth.last() > -1 || focDepth.last() > -1)
!oneCommandCode &&
(!blockComment || formatBlockComment)
) {
if (purifiedLine.match(/^}? ?else\b(?!:)/)) {
// {
Expand Down

0 comments on commit 3249f8c

Please sign in to comment.