Skip to content

在拥有类继承关系的变量值上,自动补全可能不全 #318

Closed
@uhziel

Description

@uhziel

Describe the bug
image
上面应该也提示 Foo 的 bar1、bar2 才对,结果只有 Foo2 的 bar3。

To Reproduce

---@class Foo
Foo = {}
function Foo:Constructor()
    self.bar1 = 1
    self.bar2 = 1
end

---@class Foo2: Foo
Foo2 = {}
function Foo2:Constructor()
    self.bar3 = 1
end

---@type Foo2
local v
print(v.)

拷贝上面内容到新lua文件,对“print(v.)”里的.删除再重输,可复现。

Expected behavior
应该 bar1、bar2、bar3 均出现。
btw,如果 Foo、Foo2 为 local 变量,而不是全局变量,不会有上述问题。

Screenshots
上面已附加

Environment (please complete the following information):

  • OS: Windows
  • Is WSL remote? no
  • Client: VSCode

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions