LuaLS / LuaLS/lua-language-server

Table preview with Enums

Open
#868 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement priority.low
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

```lua
Enum = {
One = 1,
Two = 2,
Three = 3
}

local s_TableEnum = {
[Enum.One] = "One",
[Enum.Two] = "Two",
[Enum.Three] = "Three"
}

local s_Table = {
[1] = "One",
[2] = "Two",
[3] = "Three"
}
```
What I get:
![grafik](https://user-images.githubusercontent.com/56718716/146660348-9e3cef1d-dd64-4031-a01a-aee63a714bc9.png)
What I expect:
![grafik](https://user-images.githubusercontent.com/56718716/146660354-352e3120-b5ae-44aa-ab7d-4fc2d3a1cc68.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Lua example and compare the preview for s_TableEnum with s_Table. Trace the table-preview handling for enum-valued keys; done means enum-keyed entries display the same labels and values as the equivalent numeric-keyed table.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
developer-experience
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.