LuaLS / LuaLS/lua-language-server
Error: Request textDocument/signatureHelp failed.
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?
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
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 failure with the Lua snippet by typing fooz( and requesting signature help. Start at script/core/signature.lua:56, then follow the makeSignatures and provider call frames shown in the traceback. Done means the request no longer errors and VS Code displays the function arguments for this declaration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100