-
Beta Was this translation helpful? Give feedback.
Answered by
tomlau10
Jul 23, 2025
Replies: 1 comment 9 replies
-
AFAIK, ---@class MyClass
local cls = {}
---@return number
function cls.MyFunction()
return 1
end
---@return number
function cls:MyMethod()
return 2
end
cls. -- try trigger completion here |
Beta Was this translation helpful? Give feedback.
9 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@class
correctly on the table that defines your methods, you don't need@field
at the beginning.@class
and removing@field
, then I believe you added the@class
incorrectly.@field
takes higher priority, if at the same time you have@field GetName fun():...
, then even if you add@class
correctly on the methods table, you will still seeGetName
as a field but not method.I wonder if you just put my minimal example into your existing wo…