Skip to content

Array of a class type does not get completion #1940

@esarver

Description

@esarver

How are you using the lua-language-server?

Visual Studio Code Extension (sumneko.lua)

Which OS are you using?

Windows

What is the issue affecting?

Completion

Expected Behaviour

Definition file (In workspace)

---@meta

---@class A
---@field a fun()
---@field b number
local A {
 a = function() end,
 b = 0.0,
}

---@type A[]
x = {}

Implementation file

x[1]. -- Should provide a completion for x.a and x.b

Actual Behaviour

Definition file (In workspace)

---@meta

---@class A
---@field a fun()
---@field b number
local A {
 a = function() end,
 b = 0.0,
}

---@type A[]
x = {}

Implementation file

x[1]. -- I only see fallback text completion here

Reproduction steps

Use the example files above, do a CTRL+SPACE (request completion) on after the ..

Additional Notes

This appears to work in version 3.6.4, but is broken in all versions after that.

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