Skip to content

Commit

Permalink
fix: schedule callback to reload config after server is auto-installed (
Browse files Browse the repository at this point in the history
  • Loading branch information
williamboman committed Sep 7, 2022
1 parent 980f836 commit 601c384
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions lua/mason-lspconfig/lspconfig_hook.lua
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,15 @@ return function()
end
elseif should_auto_install(config.name) then
local pkg = registry.get_package(pkg_name)
pkg:install():once("closed", function()
if pkg:is_installed() then
-- reload config
require("lspconfig")[config.name].setup(config)
end
end)
pkg:install():once(
"closed",
vim.schedule_wrap(function()
if pkg:is_installed() then
-- reload config
require("lspconfig")[config.name].setup(config)
end
end)
)
end
end)
end

0 comments on commit 601c384

Please sign in to comment.