Skip to content

Commit d330741

Browse files
author
Jesper L. Nielsen
committed
Use get_installed_servers for LSP Servers installed with LSPInstall to
be configured.
1 parent 76327a4 commit d330741

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: lua/user/lsp/mason.lua

+8-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@ local settings = {
2323
}
2424

2525
require("mason").setup(settings)
26-
require("mason-lspconfig").setup({
26+
local status_malsp_ok, malsp = pcall(require, "mason-lspconfig")
27+
if not status_malsp_ok then
28+
vim.notify("mason-lspconfig not found")
29+
return
30+
end
31+
32+
malsp.setup({
2733
ensure_installed = servers,
2834
automatic_installation = true,
2935
})
@@ -35,7 +41,7 @@ end
3541

3642
local opts = {}
3743

38-
for _, server in pairs(servers) do
44+
for _, server in pairs(malsp.get_installed_servers()) do
3945
opts = {
4046
on_attach = require("user.lsp.handlers").on_attach,
4147
capabilities = require("user.lsp.handlers").capabilities,

0 commit comments

Comments
 (0)