LuaLS / LuaLS/lua-language-server
Additional blank lines are added to parameter descriptions in type annotations
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?
NeoVim
Which OS are you using?
MacOS
What is the issue affecting?
Hover
Expected Behaviour
For multiline descriptions in @param annotations to be displayed as if they were in a single line.
Actual Behaviour
When the description in a @param annotation spans multiple lines, a linebreak in inserted in the Markdown response, which breaks syntax highlighting:
Even after removing the preceding whitespace in the example above, formatting is still off:
Reproduction steps
- Create a
luafile with the following content:
---@param bar any This is the description
--- for bar.
local function foo(bar) end
- Hover over
foo. - Notice the broken highlighting/formatting in the description of
bar.
Additional Notes
Although VS Code doesn't have additional syntax highlighting, do note how the font style in explanation above) changes, which suggests that the issue is reproducible outside Neovim:
Log File
No response
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 from the provided Lua example by hovering over foo in NeoVim or VS Code. Start at the hover response and the formatting path for multiline @param descriptions; done means the description renders as one line without breaking Markdown syntax highlighting in both reported environments.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100