LuaLS / LuaLS/lua-language-server

Error: Request textDocument/signatureHelp failed.

Open
#2,884 3 comments 0 reactions 0 assignees View on GitHub

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

file_d%3A_Data_Development_love-11.3-win64_luals-report.log

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.