Skip to content

panic handling request textDocument/completion (autoimports) #1677

@lukpsaxo

Description

@lukpsaxo

Stack trace

panic handling request textDocument/completion Could not find symbol 'InternalIdentifier' by key 'InternalIdentifier' in module "c:/Projects/a/b/node_modules/@types/lodash/index" goroutine 1441067 [running]:
runtime/debug.Stack()
	runtime/debug/stack.go:26 +0x5e
github.com/microsoft/typescript-go/internal/lsp.(*Server).recover(0xc0000f4dc0, 0xc119702d80)
	github.com/microsoft/typescript-go/internal/lsp/server.go:532 +0x58
panic({0x7ff72291a7e0?, 0xc07381ee40?})
	runtime/panic.go:783 +0x132
github.com/microsoft/typescript-go/internal/ls.(*exportInfoMap).rehydrateCachedInfo(0xc136951090, 0xc0ebc4e008, {0x1, {0xc0392e5d71, 0xa}, {0xc0392e5d71, 0xa}, {0x0, 0x0}, {0xc052f70361, ...}, ...})
	github.com/microsoft/typescript-go/internal/ls/autoimports.go:302 +0x494
github.com/microsoft/typescript-go/internal/ls.(*exportInfoMap).search.func1(...)
	github.com/microsoft/typescript-go/internal/ls/autoimports.go:231
github.com/microsoft/typescript-go/internal/core.Map[...](...)
	github.com/microsoft/typescript-go/internal/core/core.go:57
github.com/microsoft/typescript-go/internal/ls.(*exportInfoMap).search(0xc136951090, 0xc0ebc4e008, {0xc108e5aa80?, 0xc0606f8230?}, 0x0, 0xc1369511f8, 0xc136951338)
	github.com/microsoft/typescript-go/internal/ls/autoimports.go:230 +0x3d4
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).searchExportInfosForCompletions(0xc008579ec0, {0x7ff722ca5cb0, 0xc0bafbddb0}, 0xc0ebc4e008, 0xc0f1e1d8c8, 0xc0991e7950, 0x0, 0x0, 0x1, {0xc1c426d168, ...}, ...)
	github.com/microsoft/typescript-go/internal/ls/autoimportsexportinfo.go:172 +0x3da
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData.func9()
	github.com/microsoft/typescript-go/internal/ls/completions.go:1271 +0x26c
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData.func17()
	github.com/microsoft/typescript-go/internal/ls/completions.go:1686 +0x5f6
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData.func18(...)
	github.com/microsoft/typescript-go/internal/ls/completions.go:1713
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionData(0xc008579ec0, {0x7ff722ca5cb0, 0xc0bafbddb0}, 0xc0ebc4e008, 0xc0f1e1d8c8, 0x2d71, 0xc0991e7950)
	github.com/microsoft/typescript-go/internal/ls/completions.go:1741 +0x1ee2
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).getCompletionsAtPosition(0xc008579ec0, {0x7ff722ca5cb0, 0xc0bafbddb0}, 0xc0f1e1d8c8, 0x2d71, 0x0, 0xc0991e7950, 0xc000282f90)
	github.com/microsoft/typescript-go/internal/ls/completions.go:399 +0x2dd
github.com/microsoft/typescript-go/internal/ls.(*LanguageService).ProvideCompletion(0xc008579ec0, {0x7ff722ca5cb0, 0xc0bafbddb0}, {0xc104aefc80?, 0x1?}, {0xe4febe70?, 0xc0?}, 0xc082166140, 0xc000282f90, 0xc0991e7950)
	github.com/microsoft/typescript-go/internal/ls/completions.go:50 +0xe7
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleCompletion(0xc0003501c0?, {0x7ff722ca5cb0, 0xc0bafbddb0}, 0xc008579ec0, 0xc119702c60)
	github.com/microsoft/typescript-go/internal/lsp/server.go:754 +0xff
github.com/microsoft/typescript-go/internal/lsp.init.func1.registerLanguageServiceDocumentRequestHandler[...].15({0x7ff722ca5cb0, 0xc0bafbddb0}, 0xc119702d80)
	github.com/microsoft/typescript-go/internal/lsp/server.go:518 +0x130
github.com/microsoft/typescript-go/internal/lsp.(*Server).handleRequestOrNotification(0xc0000f4dc0, {0x7ff722ca5cb0, 0xc0bafbddb0}, 0xc119702d80)
	github.com/microsoft/typescript-go/internal/lsp/server.go:424 +0x10d
github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop.func1()
	github.com/microsoft/typescript-go/internal/lsp/server.go:329 +0x3a
created by github.com/microsoft/typescript-go/internal/lsp.(*Server).dispatchLoop in goroutine 10
	github.com/microsoft/typescript-go/internal/lsp/server.go:349 +0x8aa

[Error - 9:52:05 AM] Request textDocument/completion failed.
  Message: InternalError: panic handling request textDocument/completion: Could not find symbol 'InternalIdentifier' by key 'InternalIdentifier' in module "c:/Projects/a/b/node_modules/@types/lodash/index"
  Code: -32603 

Steps to reproduce

Unsure, happened while editing. I've changed InternalIdentifier - it was a internal identifier that is definitely not defined in lodash, is not in the source code of the fileI was editing. In fact the file I was editing didn't use lodash either.

I have the latest extension - 20250903.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions