lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

Error: Request textDocument/signatureHelp failed.

Open MikuAuahDark opened this issue 1 year ago • 3 comments

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

MikuAuahDark avatar Oct 03 '24 08:10 MikuAuahDark