LuaLS / LuaLS/lua-language-server

Additional blank lines are added to parameter descriptions in type annotations

未关闭
#2,333 1 条评论 8 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Lua
星标
4.4k
派生
442
PR 合并指标
30 天内没有已合并 PR

描述

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:
image

Even after removing the preceding whitespace in the example above, formatting is still off:
image

Reproduction steps
  1. Create a lua file with the following content:
---@param bar any This is the description
---           for bar.
local function foo(bar) end
  1. Hover over foo.
  2. 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:
image

Log File

No response

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

通过在 NeoVim 或 VS Code 中将鼠标悬停在 foo 上,使用提供的 Lua 示例重现该问题。从 hover 响应以及多行 @param 描述的格式化路径入手;当描述在两个报告的环境中都呈现为一行且不破坏 Markdown 语法高亮时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
lua
领域
tooling
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。