Skip to content

Commit

Permalink
fix(nvim): unsupported lsp is not setup
Browse files Browse the repository at this point in the history
  • Loading branch information
spywhere committed Oct 31, 2023
1 parent ed74208 commit b7d3345
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
2 changes: 1 addition & 1 deletion configs/nvim/lua/lib/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ M.setup = function (name, options)
setup_lsp(server, lsps[server], options)
end
end
name(handler)
name(handler, vim.tbl_keys(lsps))
end)
end
elseif name == nil then
Expand Down
14 changes: 12 additions & 2 deletions configs/nvim/lua/plugin/autocomplete/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@ registry.install {
'williamboman/mason.nvim',
'neovim/nvim-lspconfig'
},
delay = lsp.setup(function (handler)
require('mason-lspconfig').setup {
delay = lsp.setup(function (handler, required_servers)
local mason_lsp = require('mason-lspconfig')

local available_servers = mason_lsp.get_available_servers()
for _, server in ipairs(required_servers) do
-- setup lsp manually for unsupported servers
if not available_servers[server] then
handler(server)
end
end

mason_lsp.setup {
ensure_installed = {
'bashls', 'emmet_ls', 'eslint', 'graphql', 'lua_ls', 'pyright', 'tsserver', 'vimls', 'yamlls'
},
Expand Down

0 comments on commit b7d3345

Please sign in to comment.