feat(zig): snippets (#491)
* feat: zig json init * chore: rebased package.json * feat: buildexe snip
This commit is contained in:
parent
9a91957168
commit
aea9940b12
12
package.json
12
package.json
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue