From 40b88432f8efc6beb5e90aff6517b7184eef4937 Mon Sep 17 00:00:00 2001 From: ViViDboarder Date: Fri, 31 Dec 2021 17:32:33 -0800 Subject: [PATCH] Add nvim-lsp-installer Might end up using this to install LSPs. Just playing with it for now. --- neovim/lua/plugins.lua | 6 ++++++ neovim/lua/plugins/lsp.lua | 13 +++++++++++++ neovim/plugin/lsp.lua | 1 + 3 files changed, 20 insertions(+) diff --git a/neovim/lua/plugins.lua b/neovim/lua/plugins.lua index 8addcfb..20a7047 100644 --- a/neovim/lua/plugins.lua +++ b/neovim/lua/plugins.lua @@ -189,6 +189,12 @@ return require("packer").startup({ -- Configure language servers use("neovim/nvim-lspconfig") + -- Install language servers + use({ + "williamboman/nvim-lsp-installer", + requires = "neovim/nvim-lspconfig", + }) + -- Better display of diagnostics use("folke/trouble.nvim") diff --git a/neovim/lua/plugins/lsp.lua b/neovim/lua/plugins/lsp.lua index f20f9f2..40c87f7 100644 --- a/neovim/lua/plugins/lsp.lua +++ b/neovim/lua/plugins/lsp.lua @@ -207,4 +207,17 @@ function M.config_null_ls() }) end) end + +function M.config_lsp_intaller() + utils.try_require("nvim-lsp-installer", function(lsp_installer) + lsp_installer.on_server_ready(function(server) + server:setup({ + on_attach = default_attach, + }) + end) + end, function() + print("nvim-lsp-installer not installed") + end) +end + return M diff --git a/neovim/plugin/lsp.lua b/neovim/plugin/lsp.lua index 79575a2..48c0ffc 100644 --- a/neovim/plugin/lsp.lua +++ b/neovim/plugin/lsp.lua @@ -3,6 +3,7 @@ local lsp_config = require("plugins.lsp") -- Configure my various lsp stuffs lsp_config.config_null_ls() +lsp_config.config_lsp_intaller() lsp_config.config_lsp() lsp_config.config_lsp_ui()