Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
AFCMS opened this issue Sep 7, 2022 · 1 comment
Closed

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

AFCMS opened this issue Sep 7, 2022 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@AFCMS
Copy link

AFCMS commented Sep 7, 2022

---@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
Copy link
Author

AFCMS commented Nov 3, 2022

🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants