Skip to content

Commit

Permalink
feat(zig): snippets (#491)
Browse files Browse the repository at this point in the history
* feat: zig json init
* chore: rebased package.json
* feat: buildexe snip
  • Loading branch information
Eveeifyeve authored Oct 7, 2024
1 parent 9a91957 commit aea9940
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 4 deletions.
12 changes: 8 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
}
Expand Down
29 changes: 29 additions & 0 deletions snippets/zig.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit aea9940

Please sign in to comment.