Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: do not process if commands[i] is func type #3200

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading