-
-
Notifications
You must be signed in to change notification settings - Fork 689
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
fix: improved rust-analyzer support in #[component]
macro?
#2075
Conversation
This didn't fix the case listed in #1781 for me, but I don't want to give a false negative, so I'll detail the steps I took:
I made sure to restart the rust-analyzer server. |
I agree, it actually doesn't fix the particular case in #1781 for me either, I think because that case includes a syntax error that prevents it from parsing the whole function. It's a bit difficult because we do need to parse the function signature in order to remove the |
@reedwoodruff Thanks a lot. I actually just went back to try to address the issue (namely, that if there's a syntax error in the body it won't successfully parse the dummy At least, I'm now able to defeat #1781 on my machine! Invalid syntax in the If someone could test out the latest commit on this branch it would be much appreciated. Then I can try to figure out these CI issues. |
Awesome, it's working for me with the latest commit! 👍 |
… component in the body of the component needs to refer to the expanded, not unmodified, version)
R-a is working for CSR & SSR examples for me as well (SSR doesn't compile due to some renamed items, but rust-analyzer works great!) Let me know when this lands and I'll update the "DX" section of the Leptos Book accordingly (I'll keep an eye out, too). Great work! |
Ok, the issue with the tests here is that this |
This restructures the component macro so that it always emits a function with the identical name into a
#[doc(hidden)]
module named likecomponent_module_my_component
, whether the rest of the#[component]
expands successfully or not.The goal here is to provide a better rust-analyzer experience when there are syntax errors, when you are typing, etc (see #1781 and #1782, which doesn't really fix it)
If some others could let me know if this actually helps, I'd appreciate it and will fix any CI errors that arise.