lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

`@field` doesn't give field autocompletion and type hints with `fun()`

Open AFCMS opened this issue 3 years ago • 0 comments

---@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
})

AFCMS avatar Sep 07 '22 19:09 AFCMS