[nvim] fix: change deprecated LSP installer
use `mason` instead of `lsp-install`
This commit is contained in:
parent
2e26e7df30
commit
03a7796555
@ -5,7 +5,8 @@
|
||||
|
||||
|
||||
local lspconfig = require("lspconfig")
|
||||
local lsp_installer = require("nvim-lsp-installer")
|
||||
local mason = require("mason")
|
||||
local mason_lspconfig = require("mason-lspconfig")
|
||||
|
||||
local globals = require("globals")
|
||||
local signs = {
|
||||
@ -58,8 +59,8 @@ local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
|
||||
|
||||
local servers = { "clangd", "sumneko_lua", "texlab" }
|
||||
lsp_installer.setup {
|
||||
ensure_installed = servers,
|
||||
|
||||
mason.setup({
|
||||
ui = {
|
||||
icons = {
|
||||
server_installed = "✓",
|
||||
@ -67,7 +68,12 @@ lsp_installer.setup {
|
||||
server_uninstalled = ""
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
mason_lspconfig.setup({
|
||||
ensure_installed = servers,
|
||||
})
|
||||
|
||||
|
||||
for _, server in ipairs(servers) do
|
||||
local opts = {
|
||||
|
@ -69,7 +69,8 @@ return require("packer").startup(function()
|
||||
use {
|
||||
"neovim/nvim-lspconfig",
|
||||
requires = {
|
||||
"williamboman/nvim-lsp-installer",
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
},
|
||||
config = function() require("plugin.lsp") end
|
||||
}
|
||||
|
Reference in New Issue
Block a user