Skip to content

Commit 520c609

Browse files
authored
fix: lspstart should be work without arg (neovim#2090)
1 parent bdfcca4 commit 520c609

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

Diff for: lua/lspconfig.lua

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ local M = {
55
}
66

77
function M.available_servers()
8-
vim.deprecate(
9-
'lspconfig.available_servers',
10-
'lspconfig.util.available_servers',
11-
'0.1.4',
12-
'lspconfig'
13-
)
8+
vim.deprecate('lspconfig.available_servers', 'lspconfig.util.available_servers', '0.1.4', 'lspconfig')
149
return M.util.available_servers()
1510
end
1611

Diff for: plugin/lspconfig.lua

+7-6
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,18 @@ end, {
5555
})
5656

5757
vim.api.nvim_create_user_command('LspStart', function(info)
58-
local server_name = info.args[1] ~= '' and info.args
58+
local server_name = string.len(info.args) > 0 and info.args or nil
5959
if server_name then
6060
local config = require('lspconfig.configs')[server_name]
6161
if config then
6262
config.launch()
63+
return
6364
end
64-
else
65-
local other_matching_configs = require('lspconfig.util').get_other_matching_providers(vim.bo.filetype)
66-
for _, config in ipairs(other_matching_configs) do
67-
config.launch()
68-
end
65+
end
66+
67+
local other_matching_configs = require('lspconfig.util').get_other_matching_providers(vim.bo.filetype)
68+
for _, config in ipairs(other_matching_configs) do
69+
config.launch()
6970
end
7071
end, {
7172
desc = 'Manually launches a language server',

0 commit comments

Comments
 (0)