lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

Feature Request: Error When Using Non-Existant Enum Value

Open GiuseppeIII opened this issue 1 year ago • 1 comments

It would be nice when trying to use a non-extistant enum value in a function there was a warning. Ex:

---@enum TestEnum
TestEnum = {
	ONE = "ONE",
	TWO = "TWO",
}

local test = TestEnum.ONE
if (test == TestEnum.ONE) then
	print("ONE")
end

if (test == TestEnum.TOO) then
	print("TOO")
end

It would be nice if when trying to do TestEnum.TOO there was an error that TOO wasn't a value on TestEnum

GiuseppeIII avatar Aug 20 '23 23:08 GiuseppeIII

yesss exactly that would be amazing

dganzella avatar Jan 27 '24 14:01 dganzella