Skip to content

inconsistent behavior for diagnosis (missing-fields). #2769

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
NeOzay opened this issue Jul 22, 2024 · 0 comments
Closed

inconsistent behavior for diagnosis (missing-fields). #2769

NeOzay opened this issue Jul 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@NeOzay
Copy link
Contributor

NeOzay commented Jul 22, 2024

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

a warning is triggered when declaring a table with missing fields

Actual Behaviour

the diagnosis is not triggered if the annotation is declared several times.

I don't know if it would be useful if the diagnosis could also search for the defined fields of the class?

Reproduction steps

---@class Foo
---@field x number
---@field y number

---@class Foo
Foo = {}
Foo.x = 1
Foo.y = 2

---@type Foo 
local foo = {} -- not trigger

Additional Notes

I will open a PR for this problem.

Log File

No response

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