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

[Feature Request] Allow mark any as @enum

Open d-enk opened this issue 1 year ago • 2 comments

Issue Description

---@enum Type
local Type = {
	A = 1,
	B = 2,
	-- ...
}

---@return {[string]: integer}
function Generate_enum()
	return {}
end

---@enum (partial) Type
local Type2 = {}

for k, v in pairs(Generate_enum()) do
	Type2[k] = v
end

---@enum (partial) Type
local Type3 = Generate_enum()

image

image

The point is to achieve the same behavior for Type3 as for Type2.

d-enk avatar Aug 23 '24 11:08 d-enk