Skip to content

Commit 708ac22

Browse files
author
gmickus
committed
Parse THEN keyword in ELSE statement
1 parent b66f573 commit 708ac22

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/v2/formatters/if/IfFormatter.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,14 @@ export class IfFormatter extends AFormatter implements IFormatter {
145145
let newString = "";
146146

147147
switch (node.type) {
148+
case SyntaxNodeType.ThenKeyword:
149+
newString = this.settings.newLineBeforeThen()
150+
? fullText.eolDelimiter +
151+
" ".repeat(this.startColumn) +
152+
FormatterHelper.getCurrentText(node, fullText).trim()
153+
: " " +
154+
FormatterHelper.getCurrentText(node, fullText).trim();
155+
break;
148156
case SyntaxNodeType.ElseKeyword:
149157
newString =
150158
fullText.eolDelimiter +

0 commit comments

Comments
 (0)