From 1dcd67813747f7dcd606c1ea198fafffb54c9145 Mon Sep 17 00:00:00 2001 From: Evie Litherland-Smith Date: Tue, 21 Feb 2023 17:31:50 +0000 Subject: [PATCH] Add mason plugins for null_ls and nvim_dap --- config/nvim/lua/config/mason_lspconfig.lua | 2 +- config/nvim/lua/config/mason_null_ls.lua | 5 +++++ config/nvim/lua/config/mason_nvim_dap.lua | 5 +++++ config/nvim/lua/lsp/config.lua | 10 ++++++++++ config/nvim/lua/lsp/null_ls_sources.lua | 6 ------ config/nvim/lua/plugins/lspconfig.lua | 9 ++------- config/nvim/lua/plugins/mason.lua | 16 ++++++++++++++++ 7 files changed, 39 insertions(+), 14 deletions(-) create mode 100644 config/nvim/lua/config/mason_null_ls.lua create mode 100644 config/nvim/lua/config/mason_nvim_dap.lua diff --git a/config/nvim/lua/config/mason_lspconfig.lua b/config/nvim/lua/config/mason_lspconfig.lua index 6fdde511..43d05674 100644 --- a/config/nvim/lua/config/mason_lspconfig.lua +++ b/config/nvim/lua/config/mason_lspconfig.lua @@ -1,4 +1,4 @@ return { ensure_installed = { "lua_ls" }, - automatic_installation = true, + automatic_installation = false, } diff --git a/config/nvim/lua/config/mason_null_ls.lua b/config/nvim/lua/config/mason_null_ls.lua new file mode 100644 index 00000000..bcfbfeac --- /dev/null +++ b/config/nvim/lua/config/mason_null_ls.lua @@ -0,0 +1,5 @@ +return { + ensure_installed = { "stylua", "prettier" }, + automatic_installation = false, + automatic_setup = true, +} diff --git a/config/nvim/lua/config/mason_nvim_dap.lua b/config/nvim/lua/config/mason_nvim_dap.lua new file mode 100644 index 00000000..8f975c8f --- /dev/null +++ b/config/nvim/lua/config/mason_nvim_dap.lua @@ -0,0 +1,5 @@ +return { + ensure_installed = {}, + automatic_installation = false, + automatic_setup = true, +} diff --git a/config/nvim/lua/lsp/config.lua b/config/nvim/lua/lsp/config.lua index 4cd03cb8..0d4f8777 100644 --- a/config/nvim/lua/lsp/config.lua +++ b/config/nvim/lua/lsp/config.lua @@ -16,6 +16,8 @@ end require("mason").setup() require("mason-lspconfig").setup(require "config.mason_lspconfig") +require("mason-null-ls").setup(require "config.mason_null_ls") +require("mason-nvim-dap").setup() require("neodev").setup() M.on_attach = require "lsp.attach" @@ -31,5 +33,13 @@ require("mason-lspconfig").setup_handlers { } end, } +require("null-ls").setup { + sources = require "lsp.null_ls_sources", + on_attach = M.on_attach, + flags = M.lsp_flags, + capabilities = M.capabilities, +} +require("mason-null-ls").setup_handlers() +require("mason-nvim-dap").setup_handlers() return M diff --git a/config/nvim/lua/lsp/null_ls_sources.lua b/config/nvim/lua/lsp/null_ls_sources.lua index 3c39fb19..6aadd46c 100644 --- a/config/nvim/lua/lsp/null_ls_sources.lua +++ b/config/nvim/lua/lsp/null_ls_sources.lua @@ -1,13 +1,7 @@ local null_ls = require "null-ls" return { null_ls.builtins.code_actions.gitsigns, - null_ls.builtins.diagnostics.mypy, null_ls.builtins.diagnostics.zsh, - null_ls.builtins.formatting.black, - null_ls.builtins.formatting.isort, null_ls.builtins.formatting.trim_whitespace, - null_ls.builtins.formatting.stylua, - null_ls.builtins.formatting.shfmt, - null_ls.builtins.formatting.prettier, null_ls.builtins.hover.dictionary, } diff --git a/config/nvim/lua/plugins/lspconfig.lua b/config/nvim/lua/plugins/lspconfig.lua index 183a2dd0..2e69484a 100644 --- a/config/nvim/lua/plugins/lspconfig.lua +++ b/config/nvim/lua/plugins/lspconfig.lua @@ -15,13 +15,7 @@ return { { "windwp/nvim-autopairs" }, }, config = function() - local config = require "lsp.config" - require("null-ls").setup { - sources = require "lsp.null_ls_sources", - on_attach = config.on_attach, - flags = config.lsp_flags, - capabilities = config.capabilities, - } + require "lsp.config" require "lsp.cmp" end, }, @@ -42,5 +36,6 @@ return { cmd = "CmpStatus", }, { "jose-elias-alvarez/null-ls.nvim", dependencies = { "neovim/nvim-lspconfig" }, lazy = true }, + { "mfussenegger/nvim-dap", dependencies = {"neovim/nvim-lspconfig"}, lazy = true }, { "folke/neodev.nvim", dependencies = { "neovim/nvim-lspconfig", "hrsh7th/nvim-cmp" }, lazy = true }, } diff --git a/config/nvim/lua/plugins/mason.lua b/config/nvim/lua/plugins/mason.lua index e23604e4..1d963596 100644 --- a/config/nvim/lua/plugins/mason.lua +++ b/config/nvim/lua/plugins/mason.lua @@ -12,4 +12,20 @@ return { }, lazy = true, }, + { + "jay-babu/mason-null-ls.nvim", + dependencies = { + "jose-elias-alvarez/null-ls.nvim", + "neovim/nvim-lspconfig", + }, + lazy = true, + }, + { + "jay-babu/mason-nvim-dap.nvim", + dependencies = { + "mfussenegger/nvim-dap", + "neovim/nvim-lspconfig", + }, + lazy = true, + }, }