Skip to content

Commit

Permalink
Use get_installed_servers for LSP Servers installed with LSPInstall to
Browse files Browse the repository at this point in the history
be configured.
  • Loading branch information
Jesper L. Nielsen committed Nov 1, 2022
1 parent 76327a4 commit d330741
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions lua/user/lsp/mason.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@ local settings = {
}

require("mason").setup(settings)
require("mason-lspconfig").setup({
local status_malsp_ok, malsp = pcall(require, "mason-lspconfig")
if not status_malsp_ok then
vim.notify("mason-lspconfig not found")
return
end

malsp.setup({
ensure_installed = servers,
automatic_installation = true,
})
Expand All @@ -35,7 +41,7 @@ end

local opts = {}

for _, server in pairs(servers) do
for _, server in pairs(malsp.get_installed_servers()) do
opts = {
on_attach = require("user.lsp.handlers").on_attach,
capabilities = require("user.lsp.handlers").capabilities,
Expand Down

0 comments on commit d330741

Please sign in to comment.