LuaLS / LuaLS/lua-language-server
cannot recognize emmy field
Open
Nobody has claimed this yet.
feat/LuaCats Annotations
question
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
I have defined an emmy class role:
---@class role
---@field equipment_mgr equipment_mgr
an emmy class equipment_mgr:
---@class equipment_mgr
local data = {
role = role, ---@type role
equipment = orm_equipment, ---@type table<integer, db.Equipment>
}
then add some method to equipment_mgr:
---@type equipment_mgr
local mt = {}
mt.__index = mt
---@return db.Equipment
function mt:get_equipment(uid)
return self.equipment[uid]
end
Lua Diagnostics cannot recognize the method get_equipment:

while other extension can
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the shown Lua class, field, metatable, and get_equipment method in Lua Diagnostics. Compare its recognition of the method with the other extension mentioned; done means Lua Diagnostics recognizes get_equipment on equipment_mgr without the reported diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100