Skip to content

Commit

Permalink
Don't drop argument if type uses generics in signature refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
mfussenegger committed Nov 1, 2023
1 parent a09f8cd commit 7356238
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lua/jdtls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -483,15 +483,15 @@ local function change_signature(bufnr, command, code_action_params)
if vim.startswith(line, "---") then
break
elseif expect_param_next and vim.startswith(line, "- ") then
local matches = { line:match("%- ((%d+):) (%w+) (%w+)") }
local matches = { line:match("%- ((%d+):) ([^ ]+) (%w+)") }
if next(matches) then
table.insert(parameters, {
name = matches[4],
originalIndex = assert(tonumber(matches[2]), "Parameter must have originalIndex"),
type = matches[3],
})
else
matches = { line:match("%- (%w+) (%w+) ?(%w*)") }
matches = { line:match("%- (%w+) ([^ ]+) ?(%w*)") }
if next(matches) then
table.insert(parameters, {
type = matches[1],
Expand Down

0 comments on commit 7356238

Please sign in to comment.