aboutsummaryrefslogtreecommitdiffstats
path: root/plugin
diff options
context:
space:
mode:
authorRaphael <glepnir@neovim.pro>2022-08-26 11:12:52 +0800
committerGitHub <noreply@github.com>2022-08-26 11:12:52 +0800
commit520c609210029e901b433c49e7c1e00dd247b47a (patch)
tree4328e826f392e975633799cff76d3987acd30962 /plugin
parentfix: add lsplog command (#2088) (diff)
downloadnvim-lspconfig-520c609210029e901b433c49e7c1e00dd247b47a.tar
nvim-lspconfig-520c609210029e901b433c49e7c1e00dd247b47a.tar.gz
nvim-lspconfig-520c609210029e901b433c49e7c1e00dd247b47a.tar.bz2
nvim-lspconfig-520c609210029e901b433c49e7c1e00dd247b47a.tar.lz
nvim-lspconfig-520c609210029e901b433c49e7c1e00dd247b47a.tar.xz
nvim-lspconfig-520c609210029e901b433c49e7c1e00dd247b47a.tar.zst
nvim-lspconfig-520c609210029e901b433c49e7c1e00dd247b47a.zip
fix: lspstart should be work without arg (#2090)
Diffstat (limited to 'plugin')
-rw-r--r--plugin/lspconfig.lua13
1 files changed, 7 insertions, 6 deletions
diff --git a/plugin/lspconfig.lua b/plugin/lspconfig.lua
index 6af2f554..5d4a8c92 100644
--- a/plugin/lspconfig.lua
+++ b/plugin/lspconfig.lua
@@ -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',