From 17141c81b8e7b73ad933798fa610efa7a0fea29a Mon Sep 17 00:00:00 2001 From: DanielBreiner Date: Sat, 7 Sep 2019 14:12:14 +0200 Subject: [PATCH] Add snippets --- package.json | 8 +++++++- snippets/pico8.json | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 snippets/pico8.json diff --git a/package.json b/package.json index e8d2df1..2f2ca1a 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,13 @@ "description": "Path to the pico8 cli (ie /Applications/PICO-8.app/Contents/MacOS/pico8 on MacOS, or C:\\WHO_KNOWS\\PICO8.EXE on windows)" } } - } + }, + "snippets": [ + { + "language": "pico8", + "path": "./snippets/pico8.json" + } + ] }, "scripts": { "vscode:prepublish": "tsc -p ./", diff --git a/snippets/pico8.json b/snippets/pico8.json new file mode 100644 index 0000000..c677865 --- /dev/null +++ b/snippets/pico8.json @@ -0,0 +1,34 @@ +{ + "function": { + "prefix": "function", + "body": [ + "function $1($2)", + "\t$2", + "end" + ] + }, + "for-range": { + "prefix": "for-range", + "body": [ + "for i=1,$1 do", + "\t$2", + "end" + ] + }, + "for-array": { + "prefix": "for-array", + "body": [ + "for el in all($1) do", + "\t$2", + "end" + ] + }, + "for-table": { + "prefix": "for-table", + "body": [ + "for key,val in pairs($1) do", + "\t$2", + "end" + ] + } +} \ No newline at end of file