leptos-rs / leptos

Build fast web applications with Rust.
https://leptos.dev
MIT License
15.96k stars 627 forks source link

Support autocompletion in the fallback functions #2644

Closed mahdi739 closed 1 month ago

mahdi739 commented 3 months ago

In the view! macro, autocompletion within fallback functions provided by Rust-analyzer doesn't work properly. It could probably happen in every component that has a ViewFn property.

https://github.com/leptos-rs/leptos/assets/86552031/3f9759b8-bcbd-4723-ab3e-45b6502c73e3

chrisp60 commented 3 months ago

Not sure if this is something Leptos would be able to address directly. Leptos does its best to support as much IDE DX as possible but can be at the wills of whatever is upstream in Rust-Analyzer. Recently there were some regressions brought about in an upstream change of RA, you may get better luck by downgrading your Rust-Analyzer version to something around March/April.

You can check out #2527 and see if anything there works more consistently for you

mahdi739 commented 3 months ago

Not sure if this is something Leptos would be able to address directly. Leptos does its best to support as much IDE DX as possible but can be at the wills of whatever is upstream in Rust-Analyzer. Recently there were some regressions brought about in an upstream change of RA, you may get better luck by downgrading your Rust-Analyzer version to something around March/April.

You can check out #2527 and see if anything there works more consistently for you

Thanks. I use the stable version of rustc (rustc 1.78.0 (9b00956e5 2024-04-29) and apparently my rust-analyzer is working well. So I guess this issue doesn't come from the R-A problem.

gbj commented 1 month ago

Autocomplete is working identically for me inside and outside the fallback in a test case on git main, will close this one for now. We will probably never have ideal rust-analyzer support inside the view macro, but it has improved over time.