Skip to content

Commit

Permalink
fix: make sure to setup nvim-lsp-installer before doing anything
Browse files Browse the repository at this point in the history
  • Loading branch information
VonHeikemen committed May 1, 2022
1 parent 40c218f commit 7f0d541
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/lsp-zero.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ local run = function(args)
end

local lsp_install = require('nvim-lsp-installer')
util.setup_lsp_installer()

for _, server in pairs(lsp_install.get_installed_servers()) do
if handle_setup == true then
Expand Down
3 changes: 2 additions & 1 deletion lua/lsp-zero/server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local state = {
}

local global_config = require('lsp-zero.settings')
local util = require('lsp-zero.utils')

M.setup = function(server_name, user_opts)
if state.exclude[server_name] then return end
Expand Down Expand Up @@ -62,7 +63,7 @@ s.call_once = function()
)

if global_config.call_servers == 'local' then
require('nvim-lsp-installer').setup({})
util.setup_lsp_installer()
end

if global_config.configure_diagnostics then
Expand Down
5 changes: 5 additions & 0 deletions lua/lsp-zero/utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,10 @@ M.read_file = function(path)
return contents
end

M.setup_lsp_installer = function()
require('nvim-lsp-installer').setup({})
M.setup_lsp_installer = function(arg) return arg end
end

return M

0 comments on commit 7f0d541

Please sign in to comment.