Skip to content

Fix wrong line separators in IntellijEditorTextField document creation#934

Merged
egorikftp merged 1 commit intomainfrom
bug/fix-Wrong-line-separators
Mar 15, 2026
Merged

Fix wrong line separators in IntellijEditorTextField document creation#934
egorikftp merged 1 commit intomainfrom
bug/fix-Wrong-line-separators

Conversation

@egorikftp
Copy link
Copy Markdown
Member

@egorikftp egorikftp commented Mar 14, 2026


📝 Changelog

If this PR introduces user-facing changes, please update the relevant Unreleased section in changelogs:

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 14, 2026

Walkthrough

The pull request addresses an issue with incorrect line separators in document creation. The fix normalizes line endings in input text before it is used in document initialization and updates. This involves converting line separators to the system-appropriate format and consistently using the normalized text value across document creation, editor operations, and effect dependencies. The changes are focused on ensuring proper line ending handling throughout the component lifecycle.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly and clearly describes the main change: fixing wrong line separators in IntellijEditorTextField document creation, which aligns with the core objective.
Description check ✅ Passed The description includes the linked issue (#933) and appropriately marks the IntelliJ Plugin changelog as updated, meeting the template requirements.
Linked Issues check ✅ Passed The changes normalize line separators using StringUtil.convertLineSeparators before document creation [#933], directly addressing the assertion error caused by CRLF sequences in the input text.
Out of Scope Changes check ✅ Passed All changes are scoped to fixing line separator handling in IntellijEditorTextField and its changelog entry; no unrelated modifications detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch bug/fix-Wrong-line-separators
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can enforce grammar and style rules using `languagetool`.

Configure the reviews.tools.languagetool setting to enable/disable rules and categories. Refer to the LanguageTool Community to learn more.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/editor/IntellijEditorTextField.kt`:
- Around line 130-136: The LaunchedEffect currently only depends on
normalizedText, so when document is null it returns early and won't re-run once
the document is created; update the LaunchedEffect key tuple to include document
(e.g., LaunchedEffect(normalizedText, document)) so the effect re-executes when
the document becomes available and then performs the edtWriteAction {
doc.setText(normalizedText) } to sync text; locate the LaunchedEffect block that
references normalizedText and document in IntellijEditorTextField and add
document to its dependency keys.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 9774d48e-8989-4904-977d-92211fde12c6

📥 Commits

Reviewing files that changed from the base of the PR and between 697ee5f and c4e8d0c.

📒 Files selected for processing (2)
  • tools/idea-plugin/CHANGELOG.md
  • tools/idea-plugin/src/main/kotlin/io/github/composegears/valkyrie/jewel/editor/IntellijEditorTextField.kt

@egorikftp egorikftp merged commit 8e38534 into main Mar 15, 2026
5 checks passed
@egorikftp egorikftp deleted the bug/fix-Wrong-line-separators branch March 15, 2026 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Issue using SVG to XML conversion

1 participant