feat(zig): snippets (#491)

* feat: zig json init
* chore: rebased package.json
* feat: buildexe snip
This commit is contained in:
Eveeifyeve 2024-10-07 14:40:13 +11:00 committed by GitHub
parent 9a91957168
commit aea9940b12
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 37 additions and 4 deletions

View File

@ -584,10 +584,14 @@
"language": "loremipsum",
"path": "./snippets/loremipsum.json"
},
{
"language": "cmake",
"path": "./snippets/cmake.json"
}
{
"language": "cmake",
"path": "./snippets/cmake.json"
},
{
"language": "zig",
"path": "./snippets/zig.json"
}
]
}
}

29
snippets/zig.json Normal file
View File

@ -0,0 +1,29 @@
{
"Import": {
"prefix": "import",
"body": ["const ${1} = @import(\"${1}\")"],
"description": "Importing Librarys"
},
"CImport": {
"prefix": "cimport",
"body": [
"const c = @cImport({",
"@cDefine(\"${1}\")",
"});"
],
"description": "Importing C Header Files"
},
"buildExe": {
"prefix": "bExe",
"body": [
"const exe = b.addExecutable(.{",
".name = \"${1}",\",
".root_source_file = b.path(\"${2: path}\"),",
".target = target,",
".optimize = optimize,",
"});",
"\n\n\n b.installArtifact(exe);",
],
"description": "Building an exe"
}
}