typescript-go icon indicating copy to clipboard operation
typescript-go copied to clipboard

Panic handling request completionItem/resolve Some exportInfo should match the specified exportMapKey

Open pedro757 opened this issue 1 month ago • 1 comments

Stack trace

[ERROR][2025-11-21 09:50:50] /usr/share/nvim/runtime/lua/vim/lsp/log.lua:151	"rpc"	"tsgo"	"stderr"	"panic handling request completionItem/resolve Some exportInfo should match the specified exportMapKey goroutine 38736 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:26 +0x5e\ngithub.com/microsoft/typescript-go/internal/lsp.(*Server).recover(0xc000238008, 0xc01ded01e0)\n\tgithub.com/microsoft/typescript-go/internal/lsp/server.go:572 +0x58\npanic({0xb46f40?, 0xee83f0?})\n\truntime/panic.go:783 +0x132\ngithub.com/microsoft/typescript-go/internal/ls.(*LanguageService).getImportCompletionAction(0xc01da9e420, {0xef1228, 0xc01da9e3c0}, 0xc029a2b908, 0xc029086b88?, 0xc00b787bd0?, 0xc02a61fb08, 0xb22, {{0xc005e06714, 0x4}, ...}, ...)\n\tgithub.com/microsoft/typescript-go/internal/ls/autoimports.go:367 +0x30c\ngithub.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionItemActions(0xc01da9e420, {0xef1228, 0xc01da9e3c0}, 0xc029a2b908, 0xc02a61fb08, 0xb23, 0xc00091aa00, 0xc00091b1c0)\n\tgithub.com/microsoft/typescript-go/internal/ls/completions.go:5328 +0x49a\ngithub.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionItemDetails(0xc01da9e420, {0xef1228, 0xc01da9e3c0}, 0xc00009c180?, 0xb23, 0xc02a61fb08, 0xc0612e21e0, 0xc00091aa00)\n\tgithub.com/microsoft/typescript-go/internal/ls/completions.go:5072 +0x5ff\ngithub.com/microsoft/typescript-go/internal/ls.(*LanguageService).ResolveCompletionItem(0xc01da9e420, {0xef1228, 0xc01da9e3c0}, 0xc0612e21e0, 0xc00091aa00)\n\tgithub.com/microsoft/typescript-go/internal/ls/completions.go:4996 +0x85\ngithub.com/microsoft/typescript-go/internal/lsp.(*Server).handleCompletionItemResolve(0xc000238008, {0xef1228, 0xc01da9e3c0}, 0xc0612e21e0, 0xc01ded01e0)\n\tgithub.com/microsoft/typescript-go/internal/lsp/server.go:896 +0x125\ngithub.com/microsoft/typescript-go/internal/lsp.init.func1.registerRequestHandler[...].30({0xef1228, 0xc01da9e3c0}, 0xc01ded01e0)\n\tgithub.com/microsoft/typescript-go/internal/lsp/server.go:534 +0xb6\ngithub.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0xc000238008, {0xef1260?, 0xc037a952c0?}, 0xc01ded01e0)\n\tgithub.com/microsoft/typescript-go/internal/lsp/server.go:451 +0x153\ngithub.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()\n\tgithub.com/microsoft/typescript-go/internal/lsp/server.go:354 +0x3a\ncreated by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 34\n\tgithub.com/microsoft/typescript-go/internal/lsp/server.go:374 +0x9ad\n\n"
[ERROR][2025-11-21 09:50:50] /usr/share/nvim/runtime/lua/vim/lsp/log.lua:151	"LSP[tsgo]"	"on_error"	{ code = "NO_RESULT_CALLBACK_FOUND", err = { id = 129, jsonrpc = "2.0", result = vim.NIL } }

Steps to reproduce

1.Copy this code

      [].reduce((acc, curr) => {
        acc[curr.id] ??= {
          id: curr.id,
          // type data
        };
        return acc;
      }, {} as Record<number, any>)
  1. type data

https://github.com/user-attachments/assets/a8181932-3da6-486e-bfc3-32f61f5114c7

pedro757 avatar Nov 21 '25 13:11 pedro757

panic handling request completionItem/resolve Some exportInfo should match the specified exportMapKey goroutine 38736 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x5e
github.com/microsoft/typescript-go/internal/lsp.(*Server).recover(0xc000238008, 0xc01ded01e0)
	github.com/microsoft/typescript-go/internal/lsp/server.go:572 +0x58
panic({0xb46f40?, 0xee83f0?})
	runtime/panic.go:783 +0x132
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getImportCompletionAction(0xc01da9e420, {0xef1228, 0xc01da9e3c0}, 0xc029a2b908, 0xc029086b88?, 0xc00b787bd0?, 0xc02a61fb08, 0xb22, {{0xc005e06714, 0x4}, ...}, ...)
	github.com/microsoft/typescript-go/internal/ls/autoimports.go:367 +0x30c
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionItemActions(0xc01da9e420, {0xef1228, 0xc01da9e3c0}, 0xc029a2b908, 0xc02a61fb08, 0xb23, 0xc00091aa00, 0xc00091b1c0)
	github.com/microsoft/typescript-go/internal/ls/completions.go:5328 +0x49a
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionItemDetails(0xc01da9e420, {0xef1228, 0xc01da9e3c0}, 0xc00009c180?, 0xb23, 0xc02a61fb08, 0xc0612e21e0, 0xc00091aa00)
	github.com/microsoft/typescript-go/internal/ls/completions.go:5072 +0x5ff
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).ResolveCompletionItem(0xc01da9e420, {0xef1228, 0xc01da9e3c0}, 0xc0612e21e0, 0xc00091aa00)
	github.com/microsoft/typescript-go/internal/ls/completions.go:4996 +0x85
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleCompletionItemResolve(0xc000238008, {0xef1228, 0xc01da9e3c0}, 0xc0612e21e0, 0xc01ded01e0)
	github.com/microsoft/typescript-go/internal/lsp/server.go:896 +0x125
github.com/microsoft/typescript-go/internal/lsp.init.func1.registerRequestHandler[...].30({0xef1228, 0xc01da9e3c0}, 0xc01ded01e0)
	github.com/microsoft/typescript-go/internal/lsp/server.go:534 +0xb6
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0xc000238008, {0xef1260?, 0xc037a952c0?}, 0xc01ded01e0)
	github.com/microsoft/typescript-go/internal/lsp/server.go:451 +0x153
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
	github.com/microsoft/typescript-go/internal/lsp/server.go:354 +0x3a
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 34
	github.com/microsoft/typescript-go/internal/lsp/server.go:374 +0x9ad

jakebailey avatar Dec 11 '25 18:12 jakebailey