Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't discard nodes with non adjacent error siblings #2860

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

AndreasArvidsson
Copy link
Member

Today we discard parse tree nodes if any of the ancestral nodes has a error. That means that any of the ancestral nodes has a descendant that is an error node. That could be something a hundred lines below that isn't really relevant to the node we are evaluating. This updates changes so we only look at error nodes that are adjacent to our ascending path.

@AndreasArvidsson AndreasArvidsson requested a review from a team as a code owner February 22, 2025 13:43
usePrePhraseSnapshot: false
initialState:
documentContents: |
<div bbb={() => null}>hello &</div>
Copy link
Member Author

@AndreasArvidsson AndreasArvidsson Feb 22, 2025

Choose a reason for hiding this comment

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

This test fails on main. & is not a valid syntax in jsx. Because of this > in => was incorrectly used as a pair delimiter.
I actually ran into this in code I was working on where the & was about a hundred lines below the =>. That took some figuring out.

@AndreasArvidsson AndreasArvidsson requested a review from pokey March 29, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant