feat(filetypes): Declare the wgsl in the same lua module as others

This commit is contained in:
kalmenn 2024-09-13 19:21:13 +02:00
parent 442e0430b7
commit 0035b4c016
Signed by: kalmenn
GPG key ID: F500055C44BC3834
2 changed files with 1 additions and 16 deletions

View file

@ -11,5 +11,6 @@ vim.filetype.add({
return "typst" return "typst"
end, end,
idr = "idris2", idr = "idris2",
wgsl = "wgsl",
}, },
}) })

View file

@ -1,17 +1,3 @@
--- Automatically set the filetype for all buffers matching a pattern.
--- Uses an autocommand under the hood
--- @param pattern string|string[] What buffers to match on.
--- @see vim.api.nvim_create_autocmd
--- @param filetype string The filetype to set for the matching buffers
local function bind_filetype(pattern, filetype)
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
pattern = pattern,
callback = function()
vim.bo.filetype = filetype
end,
})
end
return { return {
{ import = "plugins/languages" }, { import = "plugins/languages" },
{ {
@ -71,8 +57,6 @@ return {
local capabilities = require("cmp_nvim_lsp").default_capabilities() local capabilities = require("cmp_nvim_lsp").default_capabilities()
local lspconfig = require("lspconfig") local lspconfig = require("lspconfig")
bind_filetype("*.wgsl", "wgsl")
require("mason-lspconfig").setup({ require("mason-lspconfig").setup({
handlers = { handlers = {
-- default handler -- default handler