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

Autocomplete rsx #2421

Merged
merged 11 commits into from
May 22, 2024
Merged

Autocomplete rsx #2421

merged 11 commits into from
May 22, 2024

Conversation

ealmloff
Copy link
Member

@ealmloff ealmloff commented May 16, 2024

Autocompleting RSX

This PR changes the expansion of rsx slightly to enable rust analyzer to autocomplete elements, attributes, components and braces while you type partially based on this blog post. Our macro is still ambiguous while typing the first element/last attribute

rsx! {
    div {
        w // It isn't clear while you are typing if you are making an attribute or an element
    }
}

To get around this, we create a completions module that can expand to both an attribute or element and let the user choose.

It also fixes a few span issues causing confusing error messages when a component prop is missing or the definition of an event handler closure was incorrect

Screen.Recording.2024-05-16.at.4.42.56.PM.mov

Breaking changes

This PR includes breaking changes to the rsx macro which requires changes in all dioxus_element structures. This will only effect libraries that define a custom set of elements for dioxus to use

Fixes #2422

@ealmloff ealmloff added breaking This is a breaking change tweak Small changes to improve experience rsx Related to rsx or the dioxus-rsx crate labels May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking This is a breaking change rsx Related to rsx or the dioxus-rsx crate tweak Small changes to improve experience
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Renaming value doesn't change in rsx macro
2 participants