lua-language-server
lua-language-server copied to clipboard
`@field` doesn't give field autocompletion and type hints with `fun()`
---@class definition
---@field some_stuff '"value_1"'|'"value_2"
---@field some_function fun(string): string
---@param def definition
function register(def)
....
end
register({
some_stuff = "value_1",
-- got auto-completion of the two possible values
some_function = function() end
-- got no auto-completion of the function body, unlike with `@param func fun(string): string`, and no type hints when adding the function body by hand
})