LuaLS / LuaLS/lua-language-server
Error: Request textDocument/signatureHelp failed.
未關閉
還沒有人認領這個 Issue。
- 主要語言
- Lua
- 星號
- 4.4k
- 分支
- 442
- PR 合併指標
- 30 天內沒有已合併 PR
描述
How are you using the lua-language-server?
Visual Studio Code Extension (sumneko.lua)
Which OS are you using?
Windows
What is the issue affecting?
Completion
Expected Behaviour
VSCode shows function arguments normally.
Actual Behaviour
"Request textDocument/signatureHelp failed" is shown.
[Error - 4:54:31 PM] Request textDocument/signatureHelp failed.
Message: [16:54:31.780][error][#0:script\core\signature.lua:56]: script\core\signature.lua:56: attempt to index a nil value (local 'argLabel')
stack traceback:
script\core\signature.lua:56: in upvalue 'makeOneSignature'
script\core\signature.lua:175: in upvalue 'makeSignatures'
script\core\signature.lua:209: in function 'core.signature'
script\provider\provider.lua:783: in function <script\provider\provider.lua:770>
[C]: in function 'xpcall'
script\proto\proto.lua:202: in function <script\proto\proto.lua:177>
Code: -32603
Reproduction steps
Test code:
---@class ColorClass
local Color = {}
---@alias Color ColorClass|number[]
---@alias AlignMode
---| "center"
---| "left"
---| "right"
---| "justify"
---@param args string|{text:string,wrap:boolean?,font:{path:string,size:integer}?,scale:number?,align:AlignMode?,color:Color?,outline:number?,outlineColor:Color?}
local function fooz(args)
end
The args has to be quite long to trigger it and perhaps with that specific setup of Color and AlignMode too.
Afterwards, simply write fooz( on the next line and the error should appear.
Additional Notes
No response
Log File
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
透過輸入 fooz( 並要求簽名協助,使用 Lua 程式碼片段重現此失敗。從 script/core/signature.lua:56 開始,接著追蹤 traceback 中顯示的 makeSignatures 和 provider 呼叫框架。當請求不再發生錯誤,且 VS Code 顯示此宣告的函式引數時,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- lua
- 領域
- devtools
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 48/100