diff --git a/lua/astrocommunity/pack/wgsl/README.md b/lua/astrocommunity/pack/wgsl/README.md new file mode 100644 index 000000000..a92988d1a --- /dev/null +++ b/lua/astrocommunity/pack/wgsl/README.md @@ -0,0 +1,6 @@ +# wgsl Language Pack + +This plugin pack does the following: + +- Adds `wgsl` Treesitter parser: +- Adds `wgsl` language server diff --git a/lua/astrocommunity/pack/wgsl/init.lua b/lua/astrocommunity/pack/wgsl/init.lua new file mode 100644 index 000000000..472fe3e49 --- /dev/null +++ b/lua/astrocommunity/pack/wgsl/init.lua @@ -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, + }, +}