Skip to content

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

@AFCMS

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions