From 57b6f1ad01a3e1632a5c4701756bb3683be06c50 Mon Sep 17 00:00:00 2001 From: Geequlim Date: Mon, 14 Aug 2017 20:47:31 +0800 Subject: [PATCH] Fix indentations Add more snippet --- configurations/gdscript-configuration.json | 2 +- configurations/snippets.json | 33 ++++++++++++++++++++-- 2 files changed, 32 insertions(+), 3 deletions(-) diff --git a/configurations/gdscript-configuration.json b/configurations/gdscript-configuration.json index 2f30b98..a0785f2 100644 --- a/configurations/gdscript-configuration.json +++ b/configurations/gdscript-configuration.json @@ -24,6 +24,6 @@ ], "indentationRules": { "increaseIndentPattern": "^\\s*((class|func|else|elif|for|if|match|while|enum)|(.*\\sdo\\b))\\b[^\\{;]*$", - "decreaseIndentPattern": "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(else|elif|return|break|continue)\\b)" + "decreaseIndentPattern": "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(else|elif)\\b)" } } diff --git a/configurations/snippets.json b/configurations/snippets.json index f53850c..d42950e 100644 --- a/configurations/snippets.json +++ b/configurations/snippets.json @@ -4,7 +4,7 @@ // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are: // $1, $2 for tab stops, ${id} and ${id:label} and ${1:label} for variables. Variables with the same id are connected. // Example: - "Subclass": { + "Inner class": { "prefix": "class", "body": [ "class $1 extends ${2:Reference}", @@ -57,7 +57,23 @@ "func _input_event(event):", "\t${1:pass}" ] - }, + }, + + "_draw method of Node": { + "prefix": "draw", + "body": [ + "func _draw():", + "\t${1:pass}" + ] + }, + + "_gui_input method of Node": { + "prefix": "guii", + "body": [ + "func _gui_input(event):", + "\t${1:pass}" + ] + }, "for loop": { "prefix": "for", @@ -156,6 +172,13 @@ ] }, + "Is instance of a class or script": { + "prefix": "is", + "body": [ + "${1:instance} is ${2:class}" + ] + }, + "element in array": { "prefix": "in", "body": [ @@ -192,5 +215,11 @@ "body": [ "set_process_input(true)" ] + }, + "pass statement": { + "prefix": "pass", + "body": [ + "pass" + ] } }