Skip to content

Panic in completions request within import attributes #2286

@DanielRosenwasser

Description

@DanielRosenwasser
import yadda1 from "yadda" with {/*attr*/}
import yadda2 from "yadda" with {attr/*attrEnd1*/: true}
import yadda3 from "yadda" with {attr: /*attrValue*/}

Test completions at each marker location

[error] panic handling requesttextDocument/completionUnhandled case in Node.Text: *ast.ImportAttribute goroutine 13298 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x5e
github.com/microsoft/typescript-go/internal/lsp.(*Server).recover(0xc0001e4008, 0xc021a75d70)
	github.com/microsoft/typescript-go/internal/lsp/server.go:872 +0x58
panic({0xba49e0?, 0xc005d175c0?})
	runtime/panic.go:783 +0x132
github.com/microsoft/typescript-go/internal/ast.(*Node).Text(0x4187f4?)
	github.com/microsoft/typescript-go/internal/ast/ast.go:338 +0x42d
github.com/microsoft/typescript-go/internal/core.Map[...](...)
	github.com/microsoft/typescript-go/internal/core/core.go:58
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData.func12()
	github.com/microsoft/typescript-go/internal/ls/completions.go:1372 +0x375
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData.func18(...)
	github.com/microsoft/typescript-go/internal/ls/completions.go:1689
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData(0xc010337710, {0x107f7a8, 0xc010337620}, 0xc019937908, 0xc014ebf208, 0x24, 0xc00c8ce800)
	github.com/microsoft/typescript-go/internal/ls/completions.go:1717 +0x1edf
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionsAtPosition(0xc010337710, {0x107f7a8, 0xc010337620}, 0xc014ebf208, 0x24, 0x0)
	github.com/microsoft/typescript-go/internal/ls/completions.go:383 +0x2cf
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).ProvideCompletion(0xc010337710, {0x107f7a8, 0xc010337620}, {0xc01d962e10?, 0xc010337620?}, {0x1d962e10?, 0xc0?}, 0xc001749830)
	github.com/microsoft/typescript-go/internal/ls/completions.go:44 +0xc8
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleCompletion(0xc000a08008?, {0x107f7a8?, 0xc010337620?}, 0xc01d962e10?, 0x40b92c?)
	github.com/microsoft/typescript-go/internal/lsp/server.go:1208 +0x39
github.com/microsoft/typescript-go/internal/lsp.init.func1.registerLanguageServiceDocumentRequestHandler[...].16({0x107f7a8, 0xc010337620}, 0xc021a75d70)
	github.com/microsoft/typescript-go/internal/lsp/server.go:621 +0x130
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0xc0001e4008, {0x107f7e0?, 0xc00e11d950?}, 0xc021a75d70)
	github.com/microsoft/typescript-go/internal/lsp/server.go:502 +0x14b
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
	github.com/microsoft/typescript-go/internal/lsp/server.go:405 +0x3a
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 10
	github.com/microsoft/typescript-go/internal/lsp/server.go:425 +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