Skip to content

Commit

Permalink
Do not touch for func member in commands config
Browse files Browse the repository at this point in the history
To pass it as-is to the vim.lsp.start_client argument
  • Loading branch information
blmarket committed Jun 9, 2024
1 parent 92166b8 commit 3732f0b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lua/lspconfig/util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3732f0b

Please sign in to comment.