LuaLS / LuaLS/lua-language-server
Alias comments only show for strings and numbers
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
(Split from: https://github.com/LuaLS/lua-language-server/issues/2279)
Aliases have a feature where they can be multiline and you can write comments for different available values. However, this only works for string and numbers. For example in this code:
---@class TestClass
---@enum TestEnum
TestEnum = {
TEST1 = 1,
TEST2 = 2,
TEST3 = 3,
}
---@alias TestAlias
---| 'TEST1' # TEST1 comment
---| 'TEST2' # TEST2 comment
---| 'TEST3' # TEST3 comment
---| TestClass # TestClass comment
---| TestEnum # TestEnum comment
---| TestEnum.TEST1 # TestEnum.TEST1 comment
---| 1 # TestNumber Comment
---@param test TestAlias
local function test(test)
end
test()
I get this
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report in LuaLS with the alias example from the issue, then trace how alias comments are collected and displayed for string and numeric values. Check the same behavior for TestClass, TestEnum, and TestEnum.TEST1; done means comments appear for those alias values as they do for strings and numbers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100