ソースを参照

Add strict onEnterRules for controlling indentation (#344)

Co-authored-by: Hugo Locurcio <[email protected]>
Anton Vakhtel 3 年 前
コミット
1d76541f04
1 ファイル変更70 行追加20 行削除
  1. 70 20
      configurations/gdscript-configuration.json

+ 70 - 20
configurations/gdscript-configuration.json

@@ -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"
+            }
+        }
+    ]
 }