Closed
Description
It would be awesome if functions that get passed as arguments (directly or via tables) to other functions get autocomplete for their argument types.
Examples
Directly pass a callback function to other function
---Work hard
---@param callback fun(value: number)
function work(callback)
callback(22)
end
work(function (value)
-- No autocomplete for value here
end)
or via custom table:
---@class work_item
---@field complete fun(value: number)
local work_item = {}
---Work hard
---@param item work_item
function work(item)
item.complete(42)
end
work {
complete = function (value)
-- No autocomplete for value here
end
}