Skip to content

只标记field的class #817

Closed
Closed
@HiKit

Description

@HiKit

TestA.lua

---@class TestA
---@field A number
_G.TestA = {}

Main.lua

print(TestA)

如果只给class标记field,发现无代码提示,如下图
image


如果随意给class增加一个方法,结果会有代码提示
TestA.lua

---@class TestA
---@field A number
_G.TestA = {}

function TestA:Test()

end

image


现在不确定是emmylua的特性如此,还是一个插件bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfeat/LuaCats AnnotationsRelated to Lua Language Server Annotations (LuaCats)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions