Repository navigation
Conversation
✅ Deploy Preview for eslint-code-explorer ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Code-matched highlight decorations src/utils/highlighted-ranges.ts |
highlightedRangesExtension now accepts source code and creates decorations only when the document matches it. It maps existing decorations through document changes, or creates them when the updated document matches the source code. |
Editor integration and language-switch test src/components/editor.tsx, e2e-tests/code-editing-and-ast-interaction.test.ts |
EditorProperties.value is required. The editor passes its current value to the extension and recomputes extensions when the value changes. The end-to-end test checks highlighting after switching languages and asserts that no console errors were recorded. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Possibly related PRs
- eslint/code-explorer#594: Changes how the editor receives highlight ranges and source code, which is the data paired by this change.
Suggested reviewers: patricktree
Merge Risk: 
Minimal · up to 2b9aa
-
Highlights are guarded against mismatched editor text. No material merge risk was identified.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the main change: a crash fix when switching languages while an ESQuery selector is set. The raw summary and PR objectives confirm that highlightedRangesExtension now receives the source code and creates decorations only when the editor contains that code. The title is specific and matches the changeset.
Full details: Docstring Coverage
-
Explanation
No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 3 files.
-
Finishing Touches
-
📝 Generate docstrings
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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 @coderabbitai help to get the list of available commands.
Prerequisites checklist
AI acknowledgment
What is the purpose of this pull request?
This PR fixes a crash in the editor's ESQuery highlighting when switching languages while an ESQuery selector is set.
Steps to reproduce
Literalin the ESQuery Selector.CodeMirror plugin crashed: RangeError: Position 749 is out of range for changeset of length 603in the browser console, and that the highlights are gone.What changes did you make? (Give an overview)
Made
highlightedRangesExtensiontake the code the ranges were computed for, and only create the decorations once the editor contains that code.Related Issues
Is there anything you'd like reviewers to focus on?
Summary by CodeRabbit