Skip to content

Commit

Permalink
feat(pack): add wgsl pack (#415)
Browse files Browse the repository at this point in the history
* feat(pack): add wgsl pack

* Restructure treesitter dependencies

---------

Co-authored-by: Micah Halter <[email protected]>
  • Loading branch information
mlambir and mehalter authored Jul 13, 2023
1 parent b73f3a4 commit febbbad
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lua/astrocommunity/pack/wgsl/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# wgsl Language Pack

This plugin pack does the following:

- Adds `wgsl` Treesitter parser: <https://github.com/szebniok/tree-sitter-wgsl>
- Adds `wgsl` language server
28 changes: 28 additions & 0 deletions lua/astrocommunity/pack/wgsl/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
local utils = require "astronvim.utils"
return {
{
"nvim-treesitter/nvim-treesitter",
optional = true,
dependencies = {
{
"szebniok/tree-sitter-wgsl",
build = "cp -r queries ../nvim-treesitter/queries/wgsl",
init = function() vim.filetype.add { extension = { wgsl = "wgsl" } } end,
config = function()
require("nvim-treesitter.parsers").get_parser_configs().wgsl = {
install_info = {
url = vim.fn.stdpath "data" .. "/lazy/tree-sitter-wgsl",
files = { "src/parser.c", "src/scanner.c" },
},
filetype = "wgsl",
}
end,
},
},
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "wgsl") end,
},
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "wgsl_analyzer") end,
},
}

0 comments on commit febbbad

Please sign in to comment.