fix indentation (#141997)

* fix indentation

* add tests

* make regex valid
This commit is contained in:
Andrew Jones
2022-02-03 13:51:57 +10:00
committed by GitHub
parent cdd2af7919
commit 9dc211a499
2 changed files with 19 additions and 1 deletions

View File

@@ -15,7 +15,7 @@ import * as languageModeIds from '../utils/languageIds';
const jsTsLanguageConfiguration: vscode.LanguageConfiguration = {
indentationRules: {
decreaseIndentPattern: /^((?!.*?\/\*).*\*\/)?\s*[\}\]].*$/,
increaseIndentPattern: /^((?!\/\/).)*(\{([^}"'`]*|(\t|[ ])*\/\/.*)|\([^)"'`]*|\[[^\]"'`]*)$/,
increaseIndentPattern: /^((?!\/\/).)*(\{([^}"'`/]*|(\t|[ ])*\/\/.*)|\([^)"'`/]*|\[[^\]"'`/]*)$/,
// e.g. * ...| or */| or *-----*/|
unIndentedLinePattern: /^(\t|[ ])*[ ]\*[^/]*\*\/\s*$|^(\t|[ ])*[ ]\*\/\s*$|^(\t|[ ])*[ ]\*([ ]([^\*]|\*(?!\/))*)?$/
},