Skip to content

Commit

Permalink
feat(pack): add wgsl pack
Browse files Browse the repository at this point in the history
  • Loading branch information
mlambir committed Jul 12, 2023
1 parent 3dbdce3 commit 8d920a6
Show file tree
Hide file tree
Showing 2 changed files with 29 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
23 changes: 23 additions & 0 deletions lua/astrocommunity/pack/wgsl/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
local utils = require "astronvim.utils"
return {
{
"szebniok/tree-sitter-wgsl",
dependencies = "nvim-treesitter/nvim-treesitter",
lazy = false,
build = "cp -r queries ../nvim-treesitter/queries/wgsl",
config = function()
vim.filetype.add { extension = { wgsl = "wgsl" } }
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" },
},
}
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 8d920a6

Please sign in to comment.