LuaLS / LuaLS/lua-language-server
Lines in annotations don't appear in order as written
还没有人认领这个 Issue。
- 主要语言
- Lua
- 星标
- 4.4k
- 派生
- 442
- PR 合并指标
- 30 天内没有已合并 PR
描述
Hey!
Descriptions, comment lines don't appear in order as written under any specified @param and @return description, they are displayed in bulk at the bottom. Also, the main function6object descriptions from the top line are also displayed below param and return value descriptions.
I've been using an older version of the extension (2.6.8), I updated it to see if issues I had with newer versions had been resolved since. Mostly, yes they have been and it works much faster than before so I'd like to stay - but the way I've been annotating stuff, it is a really annoying yet simple issue.
Here's an example (the detailed annotations of a function that gets and returns color values, unpacking them from the table provided):
---Returns the position values used by [Region:SetPoint(...)](https://wowpedia.fandom.com/wiki/API_ScriptRegionResizing_SetPoint) from a position table used by WidgetTools
---@param t? table Table containing parameters to call [Region:SetPoint(...)](https://wowpedia.fandom.com/wiki/API_ScriptRegionResizing_SetPoint) with
--- - **anchor**? [AnchorPoint](https://wowpedia.fandom.com/wiki/Anchors) *optional* — ***Default:*** "TOPLEFT"
--- - **relativeTo**? [Frame](https://wowpedia.fandom.com/wiki/API_CreateFrame#Frame_types)|string *optional* ― Frame reference or name | ***Default:*** UIParent if **t.relativePoint** ~= nil
--- - **relativePoint**? [AnchorPoint](https://wowpedia.fandom.com/wiki/Anchors) *optional* — ***Default:*** **t.anchor** if **t.relativeTo** ~= nil
--- - **offset**? table *optional*
--- - **x**? number *optional* — ***Default:*** 0
--- - **y**? number *optional* — ***Default:*** 0
---@return AnchorPoint anchor ***Default:*** "TOPLEFT"
--- - ***Note:*** Default to "TOPLEFT" when an invalid input is provided.
---@return Frame|nil? relativeTo ***Default:*** UIParent if **t.relativePoint** ~= nil
---@return AnchorPoint|nil? relativePoint ***Default:*** **t.anchor** if **t.relativeTo** ~= nil
---@return number? offsetX ***Default:*** 0
---@return number? offsetY ***Default:*** 0
I expect the entire text to appear as such (as it used to with the old extension version I've been using) when mousing over the function:
However, now it appears like so:
If it is the intended way of displaying annotations, that's fine - I assume some people prefer it this way but I do prefer and expect it to be displayed as it used to be, all lines rendered in order as written. If this is the case, please add a setting so everyone can specify the annotation rendering behavior to meet their preference.
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用提供的 Lua 注解示例重现 hover 输出,并将其与预期的源顺序进行比较。跟踪注解 hover 的渲染路径,然后确定保留顺序还是添加渲染设置更符合现有行为。当显示的行与所要求的顺序一致,并且任何新设置都有文档说明且由回归测试覆盖时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- lua
- 领域
- tooling
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100