Closed NeOzay closed 3 months ago
---@type Foo|Bar local x = { a = 1, b = 2, }
The diagnostic for this looks wrong to me. Foo|Bar
doesn't mean it is both types, it means it is one of those types, just as string|integer
is not both a string and an integer.
I'm not sure what the correct diagnostic should be, maybe it should be missing c
since it has most of Foo
.
What I can do is only list the Classes that include all the specified fields.
Please resolve the conflict.
What I can do is only list the Classes that include all the specified fields.
I think that would make more sense (if there is such a class)
Because in the example if you say missing fields for Bar
there would also have to be a diagnostic because additional fields which aren't defined for Bar
where added
Thank you!
linked to https://github.com/LuaLS/lua-language-server/issues/2769.
this PR allows:
better display of missing fields
detects missing index fields
support class unions