{"record":{"id":"774d09cdf8260b15","repo":"microsoft/typescript-go","slug":"completion-item-data-is-nil","errorCode":null,"errorMessage":"completion item data is nil","messagePattern":"completion item data is nil","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/ls/completions.go","lineNumber":5380,"sourceCode":"\t// Auto-import that comes attached to a class member snippet\n\tSourceClassMemberSnippet = \"ClassMemberSnippet/\"\n\t// A type-only import that needs to be promoted in order to be used at the completion location\n\tSourceTypeOnlyAlias = \"TypeOnlyAlias/\"\n\t// Auto-import that comes attached to an object literal method snippet\n\tSourceObjectLiteralMethodSnippet = \"ObjectLiteralMethodSnippet/\"\n\t// Case completions for switch statements\n\tSourceSwitchCases = \"SwitchCases/\"\n\t// Completions for an object literal expression\n\tSourceObjectLiteralMemberWithComma = \"ObjectLiteralMemberWithComma/\"\n)\n\nfunc (l *LanguageService) ResolveCompletionItem(\n\tctx context.Context,\n\titem *lsproto.CompletionItem,\n\tdata *lsproto.CompletionItemData,\n) (*lsproto.CompletionItem, error) {\n\tif data == nil {\n\t\treturn nil, errors.New(\"completion item data is nil\")\n\t}\n\n\tprogram, file := l.tryGetProgramAndFile(data.FileName)\n\tif file == nil {\n\t\treturn nil, fmt.Errorf(\"file not found: %s\", data.FileName)\n\t}\n\n\tchecker, done := program.GetTypeCheckerForFile(ctx, file)\n\tdefer done()\n\treturn l.getCompletionItemDetails(ctx, program, checker, int(data.Position), file, item, data), nil\n}\n\nfunc getCompletionDocumentationFormat(ctx context.Context) lsproto.MarkupKind {\n\treturn lsproto.PreferredMarkupKind(lsproto.GetClientCapabilities(ctx).TextDocument.Completion.CompletionItem.DocumentationFormat)\n}\n\nfunc (l *LanguageService) getCompletionItemDetails(\n\tctx context.Context,","sourceCodeStart":5362,"sourceCodeEnd":5398,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/internal/ls/completions.go#L5362-L5398","documentation":"Error \"completion item data is nil\" thrown in microsoft/typescript-go.","triggerScenarios":"Thrown at internal/ls/completions.go:5380 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}