Skip to content

overloading a class stops completing fields #2945

Closed
@Bilal2453

Description

@Bilal2453

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Linux

What is the issue affecting?

Annotations, Type Checking, Completion

Expected Behaviour

---@class Cache<K, V>: {[K]: V}
---@field foo string
---@field bar fun(p1: integer)

---@type Cache<string, table>
local members = {}

print(members.<??>) ---> expected completion: `foo`, `bar`

Actual Behaviour

---@class Cache<K, V>: {[K]: V}
---@field foo string
---@field bar fun(p1: integer)

---@type Cache<string, table>
local members = {}

print(members.<??>) ---> nothing is suggested

image

Reproduction steps

  1. Copy reproduction sample
  2. Follow instructions
  3. Auto complete on members.

Additional Notes

members is typed correctly.

image

Log File

No response

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