Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(pack): add wgsl pack #415

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
mehalter marked this conversation as resolved.
Show resolved Hide resolved
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" },
},
}
mehalter marked this conversation as resolved.
Show resolved Hide resolved
end,
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "wgsl") end,
},
mehalter marked this conversation as resolved.
Show resolved Hide resolved
{
"williamboman/mason-lspconfig.nvim",
opts = function(_, opts) opts.ensure_installed = utils.list_insert_unique(opts.ensure_installed, "wgsl_analyzer") end,
},
}