Skip to content

fix: keep ESQuery highlights aligned while typing#365

Merged
amareshsm merged 1 commit intomainfrom
fix/esquery-highlight-drift
Mar 25, 2026
Merged

fix: keep ESQuery highlights aligned while typing#365
amareshsm merged 1 commit intomainfrom
fix/esquery-highlight-drift

Conversation

@Pixel998
Copy link
Copy Markdown
Contributor

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

What is the purpose of this pull request?

This PR fixes a bug where ESQuery-highlighted ranges drift left while typing in the editor, then snap back after the debounced AST update finishes.

Steps to reproduce

  1. Enter Literal in the ESQuery Selector input.
  2. Confirm a literal in the editor is highlighted.
  3. Move the cursor to a position before that literal.
  4. Start typing in the editor.
  5. Notice the highlight shifts left as you type.
  6. Stop typing and wait for the debounce to complete.
  7. Notice the highlight returns to the correct literal.

What changes did you make? (Give an overview)

  • Remapped CodeMirror highlight decorations through document changes so the existing highlight stays anchored during live edits
  • Added an e2e regression test.

Related Issues

Is there anything you'd like reviewers to focus on?

@eslint-github-bot eslint-github-bot bot added the bug Something isn't working label Mar 25, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 25, 2026

Deploy Preview for eslint-code-explorer ready!

Name Link
🔨 Latest commit 7a29ab7
🔍 Latest deploy log https://app.netlify.com/projects/eslint-code-explorer/deploys/69c406bd095a160008124c29
😎 Deploy Preview https://deploy-preview-365--eslint-code-explorer.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@eslintbot eslintbot added this to Triage Mar 25, 2026
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Mar 25, 2026
Copy link
Copy Markdown
Contributor

@DMartens DMartens left a comment

Choose a reason for hiding this comment

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

Changes LGTM, thanks. Leaving it open for a day if someone else wants to review it.

@DMartens DMartens moved this from Needs Triage to Implementing in Triage Mar 25, 2026
Copy link
Copy Markdown
Member

@amareshsm amareshsm left a comment

Choose a reason for hiding this comment

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

LGTM.

@amareshsm amareshsm added the accepted There is consensus among the team that this change meets the criteria for inclusion label Mar 25, 2026
@amareshsm amareshsm merged commit 49969eb into main Mar 25, 2026
10 checks passed
@amareshsm amareshsm deleted the fix/esquery-highlight-drift branch March 25, 2026 17:16
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion bug Something isn't working

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

4 participants