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

Heuristic for JSX empty prop expr completion #935

Merged
merged 3 commits into from
Mar 1, 2024

Conversation

zth
Copy link
Collaborator

@zth zth commented Feb 29, 2024

This fixes a bug that made empty prop expressions in JSX not complete if in the middle of a JSX element, because of the parser not being able to provide an expr hole for the empty prop expr (which in turn is because of valid reasons).

}
}

// <MultiPropComp name="Hello" time= age="35"
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you add examples with prop punning, and where there is more than one prop assignment already?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done, check the latest commit.

@zth zth force-pushed the fix-empty-jsx-prop-completion branch from 024b994 to 0354606 Compare March 1, 2024 07:25
@zth zth requested a review from cristianoc March 1, 2024 07:26
Copy link
Collaborator

@cristianoc cristianoc left a comment

Choose a reason for hiding this comment

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

sweet

@zth zth merged commit 54d9a4d into master Mar 1, 2024
4 checks passed
@zth zth deleted the fix-empty-jsx-prop-completion branch March 1, 2024 07:30
aspeddro pushed a commit to aspeddro/rescript-vscode that referenced this pull request Mar 4, 2024
* apply heuristic for allowing empty JSX prop expr completion

* changelog

* add examples with punning
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.

2 participants