Skip to content

Signature help crash on parenthesized call #1415

@DanielRosenwasser

Description

@DanielRosenwasser

Stack trace

panic handling request textDocument/signatureHelp runtime error: invalid memory address or nil pointer dereference goroutine 6021 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x64
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1.1()
	github.com/microsoft/typescript-go/internal/lsp/server.go:357 +0x54
panic({0x7ff6a477cbc0?, 0x7ff6a4fa1390?})
	runtime/panic.go:792 +0x124
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).GetSignatureHelpItems(0x4011b55b18?, {0x7ff6a4a79d10?, 0x4016d0a1e0?}, 0x19, 0x7ff6a49256bc?, 0x4011e242c8, 0x4012747ea0, 0x40000059e0, 0x4011cf6380?)
	github.com/microsoft/typescript-go/internal/ls/signaturehelp.go:103 +0x10c
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).ProvideSignatureHelp(0x4012421290, {0x7ff6a4a79d10, 0x4016d0a1e0}, {0x40128dfef0?, 0x0?}, {0x0?, 0x0?}, 0x4012747ea0, 0x40000059e0, 0x400e983e70)
	github.com/microsoft/typescript-go/internal/ls/signaturehelp.go:47 +0x98
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleSignatureHelp(0x4000000b40, {0x7ff6a4a79d10, 0x4016d0a1e0}, 0x40129fd230)
	github.com/microsoft/typescript-go/internal/lsp/server.go:679 +0xe4
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0x400e983f68?, {0x7ff6a4a79d10?, 0x4016d0a1e0?}, 0x7ff6a46138a0?)
	github.com/microsoft/typescript-go/internal/lsp/server.go:492 +0x2c0
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
	github.com/microsoft/typescript-go/internal/lsp/server.go:370 +0x70
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 9
	github.com/microsoft/typescript-go/internal/lsp/server.go:388 +0x484

[Error - 11:41:44 AM] Request textDocument/signatureHelp failed.
  Message: InternalError: panic handling request textDocument/signatureHelp: runtime error: invalid memory address or nil pointer dereference
  Code: -32603

Steps to reproduce

This is tricky - I'm having issues getting this to happen with a manual trigger, so maybe this only occurs with the appropriate trigger reason.

In VS Code, create a file with the following contents

let x = [|someCall()|]

Highlight the entire result and add parentheses. I guess this will trigger signature help with something like the following parameters

{
    "textDocument": {
        "uri": "untitled:Untitled-1"
    },
    "position": {
        "line": 0,
        "character": 19
    },
    "context": {
        "isRetrigger": false,
        "triggerCharacter": "(",
        "triggerKind": 2
    }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions