Add strict onEnterRules for controlling indentation (#344)

Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
This commit is contained in:
Anton Vakhtel
2022-05-07 01:33:49 +10:00
committed by GitHub
parent fb96098c70
commit 1d76541f04

View File

@@ -1,36 +1,86 @@
{
"comments": {
"lineComment": "#",
"blockComment": ["\"\"\"", "\"\"\""]
"blockComment": [
"\"\"\"",
"\"\"\""
]
},
"brackets": [
["(", ")"],
["[", "]"],
["{", "}"]
[
"(",
")"
],
[
"[",
"]"
],
[
"{",
"}"
]
],
"autoClosingPairs": [
["'", "'"],
["\"", "\""],
["(", ")"],
["[", "]"],
["{", "}"]
[
"'",
"'"
],
[
"\"",
"\""
],
[
"(",
")"
],
[
"[",
"]"
],
[
"{",
"}"
]
],
"surroundingPairs": [
["'", "'"],
["\"", "\""],
["(", ")"],
["[", "]"],
["{", "}"]
[
"'",
"'"
],
[
"\"",
"\""
],
[
"(",
")"
],
[
"[",
"]"
],
[
"{",
"}"
]
],
"indentationRules": {
"increaseIndentPattern": "^\\s*((class|static func|func|else|elif|for|if|match|while|enum)|(.*\\sdo\\b))\\b[^\\{;]*$",
"decreaseIndentPattern": "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(else|elif)\\b)"
},
"folding": {
"offSide": true,
"markers": {
"start": "^\\s*#\\s*region\\b",
"end": "^\\s*#\\s*endregion\\b"
}
}
"offSide": true,
"markers": {
"start": "^\\s*#\\s*region\\b",
"end": "^\\s*#\\s*endregion\\b"
}
},
"onEnterRules": [
{
"beforeText": "^\\s*$",
"action": {
"indent": "none"
}
}
]
}