From 0035b4c0160fc887347f0a9e1c30455ae3ba0f71 Mon Sep 17 00:00:00 2001 From: kalmenn Date: Fri, 13 Sep 2024 19:21:13 +0200 Subject: [PATCH] feat(filetypes): Declare the wgsl in the same lua module as others --- lua/filetypes.lua | 1 + lua/plugins/lsp.lua | 16 ---------------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/lua/filetypes.lua b/lua/filetypes.lua index 0935b18..7c232a4 100644 --- a/lua/filetypes.lua +++ b/lua/filetypes.lua @@ -11,5 +11,6 @@ vim.filetype.add({ return "typst" end, idr = "idris2", + wgsl = "wgsl", }, }) diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index 6ceff04..e6de0d1 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -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 { { import = "plugins/languages" }, { @@ -71,8 +57,6 @@ return { local capabilities = require("cmp_nvim_lsp").default_capabilities() local lspconfig = require("lspconfig") - bind_filetype("*.wgsl", "wgsl") - require("mason-lspconfig").setup({ handlers = { -- default handler