From 81d3a0593eb1bcf106db1e2ebf604faa5af468fe Mon Sep 17 00:00:00 2001 From: gmickus Date: Fri, 18 Oct 2024 10:05:42 +0300 Subject: [PATCH] Add error handling in switch --- src/v2/formatters/tempTable/TempTableFormatter.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/v2/formatters/tempTable/TempTableFormatter.ts b/src/v2/formatters/tempTable/TempTableFormatter.ts index 9ac5558..d70df08 100644 --- a/src/v2/formatters/tempTable/TempTableFormatter.ts +++ b/src/v2/formatters/tempTable/TempTableFormatter.ts @@ -132,6 +132,9 @@ export class TempTableFormatter extends AFormatter implements IFormatter { newString = " " + text + " ".repeat(this.alignType - text.length); break; + case SyntaxNodeType.Error: + newString = FormatterHelper.getCurrentText(node, fullText); + break; default: newString = text.length === 0 ? "" : " " + text; break; @@ -159,6 +162,9 @@ export class TempTableFormatter extends AFormatter implements IFormatter { let newString = ""; const text = FormatterHelper.getCurrentText(node, fullText).trim(); switch (node.type) { + case SyntaxNodeType.Error: + newString = FormatterHelper.getCurrentText(node, fullText); + break; default: newString = text.length === 0 ? "" : " " + text; break;