fix: use file parameter instead of getActiveFile() for embed processing#123
fix: use file parameter instead of getActiveFile() for embed processing#123
Conversation
Fixes #95 where embedded markdown files were being missed when dealing with large documents. The previous code used `getActiveFile()` which could return undefined or the wrong file during async processing, especially in batch export scenarios. Now uses the `file.path` parameter which is the correct file being exported, ensuring consistent behavior regardless of active file state. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
📝 WalkthroughWalkthroughThe embed processing logic in Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: defaults Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
getActiveFile()which could return undefined or the wrong file during async processingfile.pathparameter which is the correct file being exportedProblem
When exporting large documents with multiple embedded files (e.g., ~88,000 chars), some embeds weren't being included. The issue occurred because:
getActiveFile()could returnundefinedin some scenariosSolution
file.path(the function parameter) instead ofcfile.pathfromgetActiveFile()fileparameter is the actual file being exported, so it's always correctif (cfile != undefined)check sincefile.pathis always availableTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
Release Notes
✏️ Tip: You can customize this high-level summary in your review settings.