typescript-go
typescript-go copied to clipboard
tried to delete a non-existent entry / nil pointer deref on diagnostics
Stack trace
panic: tried to delete a non-existent entry [recovered, repanicked]
goroutine 1128 [running]:
github.com/microsoft/typescript-go/internal/project.(*Snapshot).Clone.func1()
github.com/microsoft/typescript-go/internal/project/snapshot.go:201 +0x88
panic({0x7ff633f83100?, 0x7ff634455350?})
runtime/panic.go:783 +0x120
github.com/microsoft/typescript-go/internal/project/dirty.(*Map[...]).Delete(0x7ff63447c4c0, {0x4007f2a840, 0x26})
github.com/microsoft/typescript-go/internal/project/dirty/map.go:103 +0x174
github.com/microsoft/typescript-go/internal/project.(*configFileRegistryBuilder).didCloseFile(0x4007646480, {0x4007f2a840, 0x26})
github.com/microsoft/typescript-go/internal/project/configfileregistrybuilder.go:298 +0x3c
github.com/microsoft/typescript-go/internal/project.(*configFileRegistryBuilder).DidChangeFiles(0x4007646480, {{0x0, 0x0}, 0x4007646330, {0x0}, {0x0}, {0x0}, 0x0}, 0x4008d6b900)
github.com/microsoft/typescript-go/internal/project/configfileregistrybuilder.go:402 +0x564
github.com/microsoft/typescript-go/internal/project.(*ProjectCollectionBuilder).DidChangeFiles(0x4008c30100, {{0x0, 0x0}, 0x4007646330, {0x0}, {0x0}, {0x0}, 0x0}, 0x4008d6b8b0)
github.com/microsoft/typescript-go/internal/project/projectcollectionbuilder.go:186 +0x374
github.com/microsoft/typescript-go/internal/project.(*Snapshot).Clone(0x400a831700, {0x7ff634460648, 0x4007646210}, {{{0x40087ec0e0, 0x1, 0x1}, {0x0, 0x0, 0x0}, 0x0}, ...}, ...)
github.com/microsoft/typescript-go/internal/project/snapshot.go:287 +0x818
github.com/microsoft/typescript-go/internal/project.(*Session).UpdateSnapshot(0x400013e120, {0x7ff634460648, 0x4007646210}, 0x4007646270, {{{0x40087ec0e0, 0x1, 0x1}, {0x0, 0x0, 0x0}, ...}, ...})
github.com/microsoft/typescript-go/internal/project/session.go:520 +0x7c
github.com/microsoft/typescript-go/internal/project.(*Session).getSnapshot(0x400013e120, {0x7ff634460648, 0x4007646210}, {{0x40087ec0e0, 0x1, 0x1}, {0x0, 0x0, 0x0}, 0x0})
github.com/microsoft/typescript-go/internal/project/session.go:398 +0x2b0
github.com/microsoft/typescript-go/internal/project.(*Session).getSnapshotAndDefaultProject(0x400013e120, {0x7ff634460648, 0x4007646210}, {0x4004024138, 0x13})
github.com/microsoft/typescript-go/internal/project/session.go:448 +0xa4
github.com/microsoft/typescript-go/internal/project.(*Session).GetLanguageService(0x4008953ee8?, {0x7ff634460648?, 0x4007646210?}, {0x4004024138?, 0x4008953ea8?})
github.com/microsoft/typescript-go/internal/project/session.go:460 +0x28
github.com/microsoft/typescript-go/internal/lsp.init.func1.registerLanguageServiceDocumentRequestHandler[...].27({0x7ff634460648, 0x4007646210}, 0x400728a480)
github.com/microsoft/typescript-go/internal/lsp/server.go:614 +0x94
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0x400019a008, {0x7ff634460680?, 0x4008d6b7c0?}, 0x400728a480)
github.com/microsoft/typescript-go/internal/lsp/server.go:500 +0x128
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
github.com/microsoft/typescript-go/internal/lsp/server.go:403 +0x34
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 20
github.com/microsoft/typescript-go/internal/lsp/server.go:423 +0x7a0
[Info - 3:10:23 PM] Connection to server got closed. Server will restart.
...
panic handling request textDocument/diagnostic runtime error: invalid memory address or nil pointer dereference goroutine 80 [running]:
runtime/debug.Stack()
runtime/debug/stack.go:26 +0x64
github.com/microsoft/typescript-go/internal/lsp.(*Server).recover(0x40001a0008, 0x40002a6f90)
github.com/microsoft/typescript-go/internal/lsp/server.go:870 +0x44
panic({0x7ff633fbe2e0?, 0x7ff634a8ffb0?})
runtime/panic.go:783 +0x120
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).toLSPDiagnostics(0x40024d2630, {0x7ff634460648, 0x40024d25d0}, {0x400211bd88?, 0x40024d25d0?, 0x400211bde8?})
github.com/microsoft/typescript-go/internal/ls/diagnostics.go:39 +0x12c
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).ProvideDiagnostics(0x40024d2630, {0x7ff634460648, 0x40024d25d0}, {0x40001fb950?, 0x13?})
github.com/microsoft/typescript-go/internal/ls/diagnostics.go:26 +0x19c
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleDocumentDiagnostic(0x4001e57e78?, {0x7ff634460648?, 0x40024d25d0?}, 0x40001fb950?, 0x4001e57ee8?)
github.com/microsoft/typescript-go/internal/lsp/server.go:1149 +0x30
github.com/microsoft/typescript-go/internal/lsp.init.func1.registerLanguageServiceDocumentRequestHandler[...].12({0x7ff634460648, 0x40024d25d0}, 0x40002a6f90)
github.com/microsoft/typescript-go/internal/lsp/server.go:619 +0xec
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0x40001a0008, {0x7ff634460680?, 0x4001d4e550?}, 0x40002a6f90)
github.com/microsoft/typescript-go/internal/lsp/server.go:500 +0x128
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
github.com/microsoft/typescript-go/internal/lsp/server.go:403 +0x34
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 10
github.com/microsoft/typescript-go/internal/lsp/server.go:423 +0x7a0
[Error - 3:10:24 PM] Request textDocument/diagnostic failed.
Steps to reproduce
Not sure, but I saw this from closing an untitled buffer.