-
-
Notifications
You must be signed in to change notification settings - Fork 318
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
overloading a class stops completing fields #2945
Comments
AFAIK, generic classes only has limited support currently as discussed here: So this is probably a duplicate issue.
---@class Cache
---@field foo string
---@field bar fun(p1: integer)
---@diagnostic disable-next-line: duplicate-doc-alias
---@alias Cache<K, V> Cache|{[K]: V}
---@type Cache<string, table>
local members = {}
members.$ --> bar|foo
local t = members.foo --> t: string|table => it will merge the generic More discussions here: #2632 (reply in thread) |
Indeed seems like a duplicate, thanks for the suggested workaround! |
I think I have find the root cause that generic classes have no completion 🤔
However this only solves the completion problem, not the extra type problem mentioned in my previous comment. Maybe it should be reported as another issue, since this issue only talks about Anyway you can try to open a PR for it after more testing 😄 @Bilal2453 |
I see, yeah should be an easy case overall. I will reopen this just for the sake of linking it to a future PR. |
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Linux
What is the issue affecting?
Annotations, Type Checking, Completion
Expected Behaviour
Actual Behaviour
Reproduction steps
members.
Additional Notes
members
is typed correctly.Log File
No response
The text was updated successfully, but these errors were encountered: