Skip to content

Commit

Permalink
fix: lspstart should be work without arg (#2090)
Browse files Browse the repository at this point in the history
  • Loading branch information
glepnir authored Aug 26, 2022
1 parent bdfcca4 commit 520c609
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
7 changes: 1 addition & 6 deletions lua/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,7 @@ local M = {
}

function M.available_servers()
vim.deprecate(
'lspconfig.available_servers',
'lspconfig.util.available_servers',
'0.1.4',
'lspconfig'
)
vim.deprecate('lspconfig.available_servers', 'lspconfig.util.available_servers', '0.1.4', 'lspconfig')
return M.util.available_servers()
end

Expand Down
13 changes: 7 additions & 6 deletions plugin/lspconfig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,18 @@ end, {
})

vim.api.nvim_create_user_command('LspStart', function(info)
local server_name = info.args[1] ~= '' and info.args
local server_name = string.len(info.args) > 0 and info.args or nil
if server_name then
local config = require('lspconfig.configs')[server_name]
if config then
config.launch()
return
end
else
local other_matching_configs = require('lspconfig.util').get_other_matching_providers(vim.bo.filetype)
for _, config in ipairs(other_matching_configs) do
config.launch()
end
end

local other_matching_configs = require('lspconfig.util').get_other_matching_providers(vim.bo.filetype)
for _, config in ipairs(other_matching_configs) do
config.launch()
end
end, {
desc = 'Manually launches a language server',
Expand Down

0 comments on commit 520c609

Please sign in to comment.