LuaLS / LuaLS/lua-language-server
@alias comments aren't visible
Nobody has claimed this yet.
- Dominant language
- Lua
- Stars
- 4.4k
- Forks
- 442
- PR merge metrics
- No merged PRs in 30d
Description
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Linux
What is the issue affecting?
Annotations, Hover
Expected Behaviour
a comment to an alias type should be shown as regular comment to a parameter would be shown (at least if there is no comment to the @param annotation itself). The hover message should read:
function f(arg: string)
@param arg — comment from alias
Unused functions.Lua Diagnostics.(unused-function)
Unused local `f`.Lua Diagnostics.(unused-local)
Actual Behaviour
the comment to the alias type isn't shown. the hover message is:
function f(arg: string)
Unused functions.Lua Diagnostics.(unused-function)
Unused local `f`.Lua Diagnostics.(unused-local)
Reproduction steps
- cat << EOF > file.lua
---@alias t_arg string comment from alias
---@param arg t_arg
local function f(arg)
end
EOF - code file.lua
- hover over the function name and read message
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 issue in file.lua using the shown @alias and @param annotations, then inspect the hover entry point for function documentation. Done means hovering over f includes the alias comment as @param arg while retaining the existing diagnostics and respecting any explicit @param comment.
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