diff --git a/.vscode/settings.json b/.vscode/settings.json index 8289ffd8..381e4888 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,11 @@ { - "[json][jsonc]": { + "[json][jsonc][snippets]": { "editor.insertSpaces": true, "editor.tabSize": 4 }, "files.associations": { - "*.mdx": "markdown" + "*.mdx": "markdown", + "**/snippets/*.json": "snippets" }, "files.exclude": { "**/.DS_Store": true, diff --git a/package.json b/package.json index f1ff2814..e6588408 100644 --- a/package.json +++ b/package.json @@ -396,7 +396,13 @@ "when": "resourceScheme == vpk && workspaceFolderCount > 0" } ] + }, + "snippets": [ + { + "language": "vdf", + "path": "snippets/vdf.json" } + ] }, "scripts": { "vscode:prepublish": "pnpm build", diff --git a/snippets/vdf.json b/snippets/vdf.json new file mode 100644 index 00000000..acde2e53 --- /dev/null +++ b/snippets/vdf.json @@ -0,0 +1,29 @@ +{ + "EditablePanel": { + "prefix": "panel", + "body": [ + "\"$1\"", + "{", + "\t\"ControlName\"\t\t\"EditablePanel\"", + "\t\"fieldName\"\t\t\t\"$1\"", + "\t\"xpos\"\t\t\t\t\"$2\"", + "\t\"ypos\"\t\t\t\t\"$3\"", + "\t\"zpos\"\t\t\t\t\"$4\"", + "\t\"wide\"\t\t\t\t\"$5\"", + "\t\"tall\"\t\t\t\t\"$6\"", + "\t\"visible\"\t\t\t\"1\"", + "\t\"enabled\"\t\t\t\"1\"", + "\t\"bgcolor_override\"\t\"$7\"", + "}", + "" + ] + }, + "pin_to_sibling": { + "prefix": "pin", + "body": [ + "\"pin_to_sibling\"\t\t\t\"$1\"", + "\"pin_corner_to_sibling\"\t\t\"${2|PIN_TOPLEFT,PIN_TOPRIGHT,PIN_BOTTOMLEFT,PIN_BOTTOMRIGHT,PIN_CENTER_TOP,PIN_CENTER_RIGHT,PIN_CENTER_BOTTOM,PIN_CENTER_LEFT|}\"", + "\"pin_to_sibling_corner\"\t\t\"${3|PIN_TOPLEFT,PIN_TOPRIGHT,PIN_BOTTOMLEFT,PIN_BOTTOMRIGHT,PIN_CENTER_TOP,PIN_CENTER_RIGHT,PIN_CENTER_BOTTOM,PIN_CENTER_LEFT|}\"" + ] + } +}