microsoft/vscode · error · Error
Open a file to add code.
Error message
Open a file to add code.
What it means
Error "Open a file to add code." thrown in microsoft/vscode.
Source
Thrown at extensions/copilot/src/extension/intents/node/unknownIntent.ts:36
static readonly ID = Intent.Unknown;
readonly id = UnknownIntent.ID;
readonly locations = [ChatLocation.Editor, ChatLocation.Panel];
readonly description = l10n.t('Intent of this command is unclear or is not related to information technologies');
readonly commandInfo: IIntentSlashCommandInfo = { hiddenFromUser: true };
constructor(
@IInstantiationService private readonly instantiationService: IInstantiationService,
@IEndpointProvider private readonly endpointProvider: IEndpointProvider,
) { }
async invoke(invocationContext: IIntentInvocationContext): Promise<IIntentInvocation> {
const { location, documentContext, request } = invocationContext;
const endpoint = await this.endpointProvider.getChatEndpoint(request);
if (location === ChatLocation.Editor) {
if (!documentContext) {
throw new Error('Open a file to add code.');
}
return this.instantiationService.createInstance(GenericInlineIntentInvocation, this, location, endpoint, documentContext, EditStrategy.FallbackToReplaceRange);
}
return this.instantiationService.createInstance(GenericPanelIntentInvocation, this, location, endpoint, undefined, documentContext);
}
}
View on GitHub (pinned to a94b963a32)
When it happens
Trigger: Thrown at extensions/copilot/src/extension/intents/node/unknownIntent.ts:36 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/vscode@a94b963a32 (2026-08-12).
Data as JSON: /api/errors/a26e996c5a907044.
Report an issue: GitHub.