Repository navigation
ADFA-3481 | Fix editor indent OOM on Enter key event - #1465
Conversation
…-advance OOM Use a relative current/next line indent delta and treat INDENT_AUTO as a sentinel.
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review to trigger a review and subscribe this PR to future pushes, or @claude review once for a one-time review.
Tip: disable this comment in your organization's Code Review settings.
📝 WalkthroughWalkthroughThe ChangesIndent Advance Logic
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
|
@claude review once |
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, comment @claude review on this pull request to trigger a review.
Description
This PR fixes a critical
OutOfMemoryErrorthat occurs when pressing the Enter key in the code editor, and it corrects the tree-sitter indentation calculation for blank lines. I updated the logic to always request both the current and next lines to calculate a relative indent delta, ensuring accuracy regardless of file indentation width mismatches. Furthermore, I added safeguard checks against sentinel values (likeINDENT_AUTO) to prevent the application from attempting to allocate extremely large whitespace strings during indent generation.Details
Before
Screen.Recording.2026-07-01.at.9.43.31.AM.mov
After
Screen.Recording.2026-07-01.at.9.41.11.AM.mov
Ticket
ADFA-3481
Also fixes: ADFA-2544
Observation
The crash was caused by sentinel values (e.g.,
Int.MAX_VALUE) being passed unchecked into thecreateIndentutility, causing it to attempt to allocate roughly 300MB of whitespace into memory. The fallback to default advance behavior avoids this overflow.