Skip to content

Completion of table keys #1698

@firas-assaad

Description

@firas-assaad

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

image

Actual Behaviour

image

Reproduction steps

I remember that the table keys used to be correctly suggested in a previous version. In my real example I use a table<string, CustomClassType> instead of integer. I want to annotate it as table to enable type checking and coloring for the table elements.

    ---@type table<string, integer>
    local x = {
        a = 1,
        b = 2,
        c = 3
    }

    x. -- <- try to complete here

Additional Notes

No response

Log File

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions