1704
return { type: 'blob' as const, data: attachment.data, mimeType: attachment.contentType, displayName: attachment.label };
1705
}
1707
return undefined;
1708
}
1710
const path = uri.scheme === 'file' ? uri.fsPath : uri.toString();
1711
const displayName = attachment.label ?? path;
1712
if (attachment.selection) {
1714
>
const text = await this._readSelectedText(uri, attachment.selection.range);
1715
return { type: 'selection' as const, filePath: path, displayName, text, selection: attachment.selection.range };
1717
this._logService.warn(`[Copilot:${this.sessionId}] Failed to read selected text for ${uri.toString()}: ${err}`);
1718
return { type: 'file' as const, path, displayName };
1719
}
1721
if (attachment.displayKind === 'selection') {
1722
return { type: 'file' as const, path, displayName };