diff --git a/lua/custom/configs/overrides.lua b/lua/custom/configs/overrides.lua index d94c031..916c063 100644 --- a/lua/custom/configs/overrides.lua +++ b/lua/custom/configs/overrides.lua @@ -13,6 +13,8 @@ M.treesitter = { "cpp", "markdown", "markdown_inline", + "rust", + "svelte", }, indent = { enable = true, @@ -48,6 +50,31 @@ M.mason = { }, } +M.mason_lspconfig = { + ensure_installed = {}, + automatic_installation = true, + handlers = { + function (server_name) + require("lspconfig")[server_name].setup{ + on_attach = require("plugins.configs.lspconfig").on_attach, + capabilities = require("plugins.configs.lspconfig").capabilities, + } + end, + + ["lua_ls"] = function () + require("lspconfig").lua_ls.setup { + settings = { + Lua = { + diagnostics = { + globals = { "vim" } + } + } + } + } + end, + } +} + -- git support in nvimtree M.nvimtree = { git = { diff --git a/lua/custom/plugins.lua b/lua/custom/plugins.lua index 2ed8db8..1d40044 100644 --- a/lua/custom/plugins.lua +++ b/lua/custom/plugins.lua @@ -4,7 +4,6 @@ local overrides = require("custom.configs.overrides") local plugins = { -- Override plugin definition options - { "neovim/nvim-lspconfig", dependencies = { @@ -15,17 +14,23 @@ local plugins = { require "custom.configs.null-ls" end, }, + "williamboman/mason-lspconfig.nvim", }, config = function() require "plugins.configs.lspconfig" - require "custom.configs.lspconfig" + -- Use mason-lspconfig hooks instead + -- require "custom.configs.lspconfig" end, -- Override to setup mason-lspconfig }, -- override plugin configs { - "williamboman/mason.nvim", - opts = overrides.mason + "williamboman/mason-lspconfig.nvim", + dependencies = { + "williamboman/mason.nvim", + opts = overrides.mason + }, + opts = overrides.mason_lspconfig, }, {