{"record":{"id":"c17c9dd5af848594","repo":"microsoft/vscode","slug":"open-a-file-to-add-code","errorCode":null,"errorMessage":"Open a file to add code.","messagePattern":"Open a file to add code\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"extensions/copilot/src/extension/intents/node/editCodeIntent.ts","lineNumber":190,"sourceCode":"\n\t\t({ conversation, request } = await this._handleCodesearch(conversation, request, location, stream, token, documentContext, chatTelemetry));\n\t\treturn this.instantiationService.createInstance(EditIntentRequestHandler, this, conversation, request, stream, token, documentContext, location, chatTelemetry, this.getIntentHandlerOptions(request), yieldRequested).getResult();\n\t}\n\n\tprotected getIntentHandlerOptions(_request: vscode.ChatRequest): IDefaultIntentRequestHandlerOptions | undefined {\n\t\treturn undefined;\n\t}\n\n\tasync invoke(invocationContext: IIntentInvocationContext) {\n\t\tconst { location, documentContext, request } = invocationContext;\n\t\tconst endpoint = await this.endpointProvider.getChatEndpoint(request);\n\n\t\tif (location === ChatLocation.Panel || location === ChatLocation.Notebook) {\n\t\t\treturn this.instantiationService.createInstance(this.intentOptions.intentInvocation, this, location, endpoint, request, this.intentOptions);\n\t\t}\n\n\t\tif (!documentContext) {\n\t\t\tthrow new Error('Open a file to add code.');\n\t\t}\n\t\treturn this.instantiationService.createInstance(GenericInlineIntentInvocation, this, location, endpoint, documentContext, EditStrategy.FallbackToReplaceRange);\n\t}\n}\n\nclass EditIntentRequestHandler {\n\n\tconstructor(\n\t\tprivate readonly intent: EditCodeIntent,\n\t\tprivate readonly conversation: Conversation,\n\t\tprivate readonly request: vscode.ChatRequest,\n\t\tprivate readonly stream: vscode.ChatResponseStream,\n\t\tprivate readonly token: vscode.CancellationToken,\n\t\tprivate readonly documentContext: IDocumentContext | undefined,\n\t\tprivate readonly location: ChatLocation,\n\t\tprivate readonly chatTelemetry: ChatTelemetryBuilder,\n\t\tprivate readonly handlerOptions: IDefaultIntentRequestHandlerOptions | undefined,\n\t\tprivate readonly yieldRequested: () => boolean,","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/microsoft/vscode/blob/a94b963a32aa9749d69504576791fa29700ae46d/extensions/copilot/src/extension/intents/node/editCodeIntent.ts#L172-L208","documentation":"Error \"Open a file to add code.\" thrown in microsoft/vscode.","triggerScenarios":"Thrown at extensions/copilot/src/extension/intents/node/editCodeIntent.ts:190 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"a94b963a32aa9749d69504576791fa29700ae46d","analyzedAt":"2026-08-12T01:08:56.794Z","schemaVersion":2},"datasetVersion":"2026-08-12T06:17:24.410Z"}