-
Notifications
You must be signed in to change notification settings - Fork 33
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
Rustywind support for sorting Tailwind classes #116
Comments
Hi, thank you for your interest. I can add this feature, but the If |
@Rolv-Apneseth Considering you contributed to |
Sure yeah, makes sense |
see draft PR here: https://github.com/bram209/leptosfmt/pull/122/files |
Is it alright to just make it public or do you want something else from it? The actual replacing is all done in I'll also make the extraction of the |
Let me know if that PR is alright |
Hi @Rolv-Apneseth that works, thanks! I have updated the dependency on #122, would you be willing to test it out? And run it with If it works great for you, I will merge the PR and make a new release : ) |
Sure yeah, I'll check it out |
I can't seem to get it to work (even regular |
What exactly is not working? |
Sorry should have been more clear. So, running even just Is there a logging system to see what's happening? Otherwise I can have a look at the code when I have some time and do some |
Do you have a snippet of source code that did not format correctly? |
Sure yeah: #[component]
pub fn ExternalLink(#[prop()] href: String, #[prop()] content: String) -> impl IntoView {
view! {
<a class="not-italic font-bold duration-300 hover:text-black hover:underline motion-safe:transition-all hover:dark:text-slate-200"
href=href
target="_blank"
rel="noreferrer noopener"
>
{content}
</a>
}
} The release version puts I apologise if this is some problem with my system / specifically my project, as I'm not sure why it would work for you but not for me. The repo itself can be found here if that helps at all. |
by the way, your portfolio website looks nice 🤩 |
I was running it with just However, I tried creating the file outside of that repo and it works - so I guess something with the settings/setup of that repo? This is the max_width = 100 # Maximum width of each line
tab_spaces = 4 # Number of spaces per tab
indentation_style = "Auto" # "Tabs", "Spaces" or "Auto"
newline_style = "Auto" # "Unix", "Windows" or "Auto"
attr_value_brace_style = "WhenRequired" # "Always", "AlwaysUnlessLit", "WhenRequired" or "Preserve"
macro_names = ["leptos::view, view"] # Macro names which will be formatted
Thanks, the style is mostly copied from someone else though haha Edit: I just remembered that I have that repo using nightly - maybe that has something to do with it? |
I see the issue: macro_names = ["leptos::view, view"] should be: macro_names = ["leptos::view", "view"] also, please run |
Oh man, sorry about that. Yes can confirm all works beautifully now. Is there a way to add some kind of error output from |
The config is technically correct (a list of string values). So it does a successful run, formatted each file, only none of them contained a macro named “leptos::view leptos”, it did not swallow an error or anything. I suppose for this specific case we could validate that the macro name is a valid path according to the rust syntax though. |
Yeah, tricky I suppose.
It would be nice for at least that level of validation though yes. Were you thinking something simple like this (though returning errors instead of the asserts), or something more sophisticated? for macro_name in settings.macro_names {
assert!(!macro_name.is_empty());
for c in macro_name.chars() {
assert!(c.is_alphanumeric() || c == ':' || c == '_');
}
} |
Hey, just wanted to open a new issue to track this instead of asking to re-open #14 but let me know if I should close this.
Now that
rustywind_core
has been published as a library, can it now be implemented intoleptosfmt
? I would love to have this feature.Let me know if you need any help / if you'd like me to have a go at this (I can try my best).
The text was updated successfully, but these errors were encountered: