From 6fafad13bb4689600285d9e38c61958dd63c356d Mon Sep 17 00:00:00 2001 From: xiliuya <67564860+xiliuya@users.noreply.github.com> Date: Tue, 7 May 2024 17:43:34 +0800 Subject: [PATCH] add some snippet (#469) --- snippets/gdscript-mode/class | 7 +++++++ snippets/gdscript-mode/class_name | 6 ++++++ snippets/gdscript-mode/const | 6 ++++++ snippets/gdscript-mode/enum | 6 ++++++ snippets/gdscript-mode/for | 7 +++++++ snippets/gdscript-mode/func | 7 +++++++ snippets/gdscript-mode/if | 7 +++++++ snippets/gdscript-mode/ife | 9 +++++++++ snippets/gdscript-mode/match | 8 ++++++++ snippets/gdscript-mode/onready | 6 ++++++ snippets/gdscript-mode/print | 5 +++++ snippets/gdscript-mode/return | 5 +++++ snippets/gdscript-mode/setget | 6 ++++++ snippets/gdscript-mode/static_func | 7 +++++++ snippets/gdscript-mode/var | 6 ++++++ snippets/gdscript-mode/while | 7 +++++++ 16 files changed, 105 insertions(+) create mode 100644 snippets/gdscript-mode/class create mode 100644 snippets/gdscript-mode/class_name create mode 100644 snippets/gdscript-mode/const create mode 100644 snippets/gdscript-mode/enum create mode 100644 snippets/gdscript-mode/for create mode 100644 snippets/gdscript-mode/func create mode 100644 snippets/gdscript-mode/if create mode 100644 snippets/gdscript-mode/ife create mode 100644 snippets/gdscript-mode/match create mode 100644 snippets/gdscript-mode/onready create mode 100644 snippets/gdscript-mode/print create mode 100644 snippets/gdscript-mode/return create mode 100644 snippets/gdscript-mode/setget create mode 100644 snippets/gdscript-mode/static_func create mode 100644 snippets/gdscript-mode/var create mode 100644 snippets/gdscript-mode/while diff --git a/snippets/gdscript-mode/class b/snippets/gdscript-mode/class new file mode 100644 index 000000000..f857cdbd4 --- /dev/null +++ b/snippets/gdscript-mode/class @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: class +# key: cls +# group: object oriented +# -- +class ${1:class}: + $0 diff --git a/snippets/gdscript-mode/class_name b/snippets/gdscript-mode/class_name new file mode 100644 index 000000000..bfc9e184c --- /dev/null +++ b/snippets/gdscript-mode/class_name @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: class_name +# key: clsn +# group: object oriented +# -- +class_name ${1:Item} = ${2:"res://icons/item.png"} \ No newline at end of file diff --git a/snippets/gdscript-mode/const b/snippets/gdscript-mode/const new file mode 100644 index 000000000..47374c80f --- /dev/null +++ b/snippets/gdscript-mode/const @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: const +# key: const +# group: definitions +# -- +const ${1:name} = $0 \ No newline at end of file diff --git a/snippets/gdscript-mode/enum b/snippets/gdscript-mode/enum new file mode 100644 index 000000000..0f2cae1cf --- /dev/null +++ b/snippets/gdscript-mode/enum @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: enum +# key: enum +# group: definitions +# -- +enum $1 {$2} \ No newline at end of file diff --git a/snippets/gdscript-mode/for b/snippets/gdscript-mode/for new file mode 100644 index 000000000..30cdf7ca6 --- /dev/null +++ b/snippets/gdscript-mode/for @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: for ... in ... : ... +# key: for +# group : control structure +# -- +for ${var} in ${collection}: + ${0:pass} \ No newline at end of file diff --git a/snippets/gdscript-mode/func b/snippets/gdscript-mode/func new file mode 100644 index 000000000..dd666604a --- /dev/null +++ b/snippets/gdscript-mode/func @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: func +# key: f +# group: definitions +# -- +func ${1:func_name} (${2:param}): + ${0:pass} \ No newline at end of file diff --git a/snippets/gdscript-mode/if b/snippets/gdscript-mode/if new file mode 100644 index 000000000..72bf23b23 --- /dev/null +++ b/snippets/gdscript-mode/if @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: if +# key: if +# group : control structure +# -- +if ${1:condition}: + ${0:pass} \ No newline at end of file diff --git a/snippets/gdscript-mode/ife b/snippets/gdscript-mode/ife new file mode 100644 index 000000000..767d9c493 --- /dev/null +++ b/snippets/gdscript-mode/ife @@ -0,0 +1,9 @@ +# -*- mode: snippet -*- +# name: ife +# key: ife +# group : control structure +# -- +if ${1:condition}: + ${2:pass} +else: + ${3:pass} \ No newline at end of file diff --git a/snippets/gdscript-mode/match b/snippets/gdscript-mode/match new file mode 100644 index 000000000..f4ca09ea1 --- /dev/null +++ b/snippets/gdscript-mode/match @@ -0,0 +1,8 @@ +# -*- mode: snippet -*- +# name: match +# key: match +# group: control structure +# -- +match ${1:expression}: + ${2:pattern}: + ${3:pass} \ No newline at end of file diff --git a/snippets/gdscript-mode/onready b/snippets/gdscript-mode/onready new file mode 100644 index 000000000..ed381d29e --- /dev/null +++ b/snippets/gdscript-mode/onready @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: onready +# key: onr +# group: definitions +# -- +onready var ${1:name} = $0 \ No newline at end of file diff --git a/snippets/gdscript-mode/print b/snippets/gdscript-mode/print new file mode 100644 index 000000000..cc1c797e4 --- /dev/null +++ b/snippets/gdscript-mode/print @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: print +# key: p +# -- +print($0) \ No newline at end of file diff --git a/snippets/gdscript-mode/return b/snippets/gdscript-mode/return new file mode 100644 index 000000000..641a308a3 --- /dev/null +++ b/snippets/gdscript-mode/return @@ -0,0 +1,5 @@ +# -*- mode: snippet -*- +# name: return +# key: r +# -- +return $0 \ No newline at end of file diff --git a/snippets/gdscript-mode/setget b/snippets/gdscript-mode/setget new file mode 100644 index 000000000..457a5facc --- /dev/null +++ b/snippets/gdscript-mode/setget @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: setget +# key: vsg +# group: definitions +# -- +var ${1:variable} = ${2:value} setget ${3:setterfunc}, ${4:getterfunc} \ No newline at end of file diff --git a/snippets/gdscript-mode/static_func b/snippets/gdscript-mode/static_func new file mode 100644 index 000000000..e45a5bb04 --- /dev/null +++ b/snippets/gdscript-mode/static_func @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: static_func +# key: sf +# group: definitions +# -- +static func ${1:func_name} (${2:param}): + ${0:pass} \ No newline at end of file diff --git a/snippets/gdscript-mode/var b/snippets/gdscript-mode/var new file mode 100644 index 000000000..648ed11b9 --- /dev/null +++ b/snippets/gdscript-mode/var @@ -0,0 +1,6 @@ +# -*- mode: snippet -*- +# name: var +# key: var +# group: definitions +# -- +var ${1:name} = $0 \ No newline at end of file diff --git a/snippets/gdscript-mode/while b/snippets/gdscript-mode/while new file mode 100644 index 000000000..ae9e9ccc6 --- /dev/null +++ b/snippets/gdscript-mode/while @@ -0,0 +1,7 @@ +# -*- mode: snippet -*- +# name: while +# key: wh +# group: control structure +# -- +while ${1:True}: + ${0:pass} \ No newline at end of file