From 708ac22c25f747edba69f3119bc8c0c0bf94999d Mon Sep 17 00:00:00 2001 From: gmickus Date: Mon, 23 Sep 2024 09:20:45 +0300 Subject: [PATCH] Parse THEN keyword in ELSE statement --- src/v2/formatters/if/IfFormatter.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/v2/formatters/if/IfFormatter.ts b/src/v2/formatters/if/IfFormatter.ts index 85c90ea..b75e2c3 100644 --- a/src/v2/formatters/if/IfFormatter.ts +++ b/src/v2/formatters/if/IfFormatter.ts @@ -145,6 +145,14 @@ export class IfFormatter extends AFormatter implements IFormatter { let newString = ""; switch (node.type) { + case SyntaxNodeType.ThenKeyword: + newString = this.settings.newLineBeforeThen() + ? fullText.eolDelimiter + + " ".repeat(this.startColumn) + + FormatterHelper.getCurrentText(node, fullText).trim() + : " " + + FormatterHelper.getCurrentText(node, fullText).trim(); + break; case SyntaxNodeType.ElseKeyword: newString = fullText.eolDelimiter +