diff options
| author | Jeong, Heon <blmarket@gmail.com> | 2024-06-30 23:51:39 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-07-01 14:51:39 +0800 |
| commit | 53a3c6444ec5006b567071614c83edc8ad651f6d (patch) | |
| tree | 3c40b6e6b1b11e9a0c66bc9f7a64791f2137c3f0 /lua/lspconfig/util.lua | |
| parent | docs: update server_configurations.md (diff) | |
| download | nvim-lspconfig-53a3c6444ec5006b567071614c83edc8ad651f6d.tar nvim-lspconfig-53a3c6444ec5006b567071614c83edc8ad651f6d.tar.gz nvim-lspconfig-53a3c6444ec5006b567071614c83edc8ad651f6d.tar.bz2 nvim-lspconfig-53a3c6444ec5006b567071614c83edc8ad651f6d.tar.lz nvim-lspconfig-53a3c6444ec5006b567071614c83edc8ad651f6d.tar.xz nvim-lspconfig-53a3c6444ec5006b567071614c83edc8ad651f6d.tar.zst nvim-lspconfig-53a3c6444ec5006b567071614c83edc8ad651f6d.zip | |
feat: do not process commands if it's func type (#3200)
To pass it as-is to the vim.lsp.start_client argument
Diffstat (limited to 'lua/lspconfig/util.lua')
| -rw-r--r-- | lua/lspconfig/util.lua | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lua/lspconfig/util.lua b/lua/lspconfig/util.lua index a678db79..2fb5e72b 100644 --- a/lua/lspconfig/util.lua +++ b/lua/lspconfig/util.lua @@ -88,10 +88,12 @@ end function M.create_module_commands(module_name, commands) for command_name, def in pairs(commands) do - local opts = M._parse_user_command_options(def) - api.nvim_create_user_command(command_name, function(info) - require('lspconfig')[module_name].commands[command_name][1](unpack(info.fargs)) - end, opts) + if type(def) ~= 'function' then + local opts = M._parse_user_command_options(def) + api.nvim_create_user_command(command_name, function(info) + require('lspconfig')[module_name].commands[command_name][1](unpack(info.fargs)) + end, opts) + end end end |
