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