Skip to content

Commit

Permalink
Merge pull request #214 from BalticAmadeus/208-else-if-not-recognized…
Browse files Browse the repository at this point in the history
…-in-0039-version

208 Parse THEN keyword in ELSE statement
  • Loading branch information
PauliusKu authored Sep 23, 2024
2 parents b66f573 + 708ac22 commit 5842563
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/v2/formatters/if/IfFormatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 +
Expand Down

0 comments on commit 5842563

Please sign in to comment.