LuaLS / LuaLS/lua-language-server

key map value of enum

Open
#2,914 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feat/LuaCats Annotations
Dominant language
Lua
Stars
4.4k
Forks
442
PR merge metrics
No merged PRs in 30d

Description

### Issue Description

I want to try creating an Event enum to use for the registering Event method, but enum doesn't seem to support key table values
![image](https://github.com/user-attachments/assets/249a2eaa-34cb-4955-ac90-30ed36056491)
![image](https://github.com/user-attachments/assets/9484a091-44df-4832-8e96-88787ea9d2a4)
If it can be completed normally like this
but
![image](https://github.com/user-attachments/assets/d4e53148-e655-4a94-ab7c-960cd6083b41)
If you define a variable or parameter as an enumeration, lls will not know what value it has
What I want is to use extend like class, like --- @ class Event: {functionName: string,...}
but enum does not seem to support extend

### Additional Notes

_No response_

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

No source files or tests are named. Start by reproducing the Event enum, registering Event method, and enum-typed variable or parameter examples in LuaLS, then inspect the enum type-handling entry points. Done should be defined as a documented behavior for exposing key-table values and supporting the requested Event shape, with tests covering the examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.