Skip to content

table validation is not working as expected #3040

Open
@kuxynator

Description

@kuxynator

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?

Type Checking

Expected Behaviour

"inject-field" or "undefined-field" should show an error in table definition

Actual Behaviour

	"Lua.diagnostics.severity": {
		"inject-field": "Error",
		"undefined-field": "Error"
		"missing-fields": "Error"  // <-this works
	},
	---@type Foo
	local entity = {  --  <--expected error "bar  is missing"
		here_should_be_an_error ="but is not"
	}
	
	---@class (exact) Foo
	---@field bar string

Reproduction steps

  1. Go to '...'
  2. Click '...'
  3. See error '...'

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions