diff options
| author | Raphael <glepnir@neovim.pro> | 2022-08-26 11:12:52 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-26 11:12:52 +0800 |
| commit | 520c609210029e901b433c49e7c1e00dd247b47a (patch) | |
| tree | 4328e826f392e975633799cff76d3987acd30962 | |
| parent | fix: add lsplog command (#2088) (diff) | |
| download | nvim-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)
| -rw-r--r-- | lua/lspconfig.lua | 7 | ||||
| -rw-r--r-- | plugin/lspconfig.lua | 13 |
2 files changed, 8 insertions, 12 deletions
diff --git a/lua/lspconfig.lua b/lua/lspconfig.lua index 59e91ac8..cf6ac633 100644 --- a/lua/lspconfig.lua +++ b/lua/lspconfig.lua @@ -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 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', |
