Skip to content

Crash for completion for property in JSDoc /** @type */ tag #2346

@DanielRosenwasser

Description

@DanielRosenwasser

I think this is slightly different because that #2289 because that issue JSDoc that is "unhosted".

/**
 * @type {{p/**/}} 
 */

Here you actually must have an existing identifier to repro the crash.

[error] panic handling request textDocument/completion: runtime error: invalid memory address or nil pointer dereference
goroutine 2435 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x5e
github.com/microsoft/typescript-go/internal/lsp.(*Server).recover(0xc0001d6008, 0xc0104f9830)
	github.com/microsoft/typescript-go/internal/lsp/server.go:701 +0x4c
panic({0xbf44c0?, 0x16fdb70?})
	runtime/panic.go:783 +0x132
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData.func15()
	github.com/microsoft/typescript-go/internal/ls/completions.go:1450 +0xba
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData.func18(...)
	github.com/microsoft/typescript-go/internal/ls/completions.go:1692
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData(0xc00d770930, {0x109efa8, 0xc00d7708d0}, 0xc00a161908, 0xc005bfef08, 0x10, 0xc00371f400)
	github.com/microsoft/typescript-go/internal/ls/completions.go:1720 +0x1ebf
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionsAtPosition(0xc00d770930, {0x109efa8, 0xc00d7708d0}, 0xc005bfef08, 0x10, 0x0)
	github.com/microsoft/typescript-go/internal/ls/completions.go:383 +0x2cf
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).ProvideCompletion(0xc00d770930, {0x109efa8, 0xc00d7708d0}, {0xc003e9d6c8?, 0xc00d7708d0?}, {0x3e9d6c8?, 0xc0?}, 0xc01075a070)
	github.com/microsoft/typescript-go/internal/ls/completions.go:44 +0xc8
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleCompletion(0xc000480008?, {0x109efa8?, 0xc00d7708d0?}, 0xc003e9d6c8?, 0x40b92c?)
	github.com/microsoft/typescript-go/internal/lsp/server.go:1011 +0x39
github.com/microsoft/typescript-go/internal/lsp.init.func1.registerLanguageServiceDocumentRequestHandler[...].16({0x109efa8, 0xc00d7708d0}, 0xc0104f9830)
	github.com/microsoft/typescript-go/internal/lsp/server.go:617 +0x130
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0xc0001d6008, {0x109efe0?, 0xc00d38b680?}, 0xc0104f9830)
	github.com/microsoft/typescript-go/internal/lsp/server.go:501 +0x14b
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
	github.com/microsoft/typescript-go/internal/lsp/server.go:404 +0x3a
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 7
	github.com/microsoft/typescript-go/internal/lsp/server.go:424 +0x9ad

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions