From e3f0cfe0e467cc2873d7505f536be8f6058b322b Mon Sep 17 00:00:00 2001 From: Rahul Yadav Date: Mon, 22 Apr 2024 19:45:15 +0530 Subject: [PATCH] Add indentation rules Resolves #24 --- src/utility/syntaxHighlighter.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/utility/syntaxHighlighter.ts b/src/utility/syntaxHighlighter.ts index c6b56d4..a03a2c8 100644 --- a/src/utility/syntaxHighlighter.ts +++ b/src/utility/syntaxHighlighter.ts @@ -76,6 +76,10 @@ export async function highlightCodeSnippets( let languageConfiguration: monaco.languages.LanguageConfiguration = { comments: commentRules[language] as any, + indentationRules: { + decreaseIndentPattern: /^\s*\}.*$/, + increaseIndentPattern: /^.*\{[^}]*$/, + }, }; if (language === 'tact') {