LuaLS / LuaLS/lua-language-server

Lines in annotations don't appear in order as written

未關閉
#2,389 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 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:
image

However, now it appears like so:
image

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.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

首先,使用提供的 Lua 註解範例重現 hover 輸出,並將其與預期的原始碼順序進行比較。追蹤註解 hover 的渲染路徑,然後判斷保留順序或新增渲染設定何者符合現有行為。當顯示的行與要求的順序一致,且任何新設定都有文件說明並由回歸測試涵蓋時,即表示完成。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
lua
領域
tooling
Issue 類型
缺陷
難度
4/5
預估耗時
3-5 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。