leptos-rs / book

The home for the Leptos book, which can be found deployed at https://book.leptos.dev
MIT License
73 stars 60 forks source link

"Leptos DX" chapter - remove component macro from ignored list #2

Closed diversable closed 9 months ago

diversable commented 9 months ago

Remove "component" from the list of procMacro.ignored... for all code editors listed, since rust-analyzer support is now enabled inside #[component] macros in Leptos > v0.5.3.

For reference:

From Leptos v0.5.3 release notes: Release v0.5.3 · leptos-rs/leptos · GitHub """ Improved rust-analyzer support in #[component] macro body

Good LSP support for proc macros is hard, because proc macros depend on parsing a stream of input into a valid Rust syntax tree, but while typing you are constantly creating a stream of new, invalid trees. This release tweaks how the #[component] macro emits code in order to enable better rust-analyzer support within the body of components.

If you've disabled rust-analyzer inside #[component] for better DX, try toggling that off and see if this is a better experience than it was before!

Apologies for any regressions this causes. Please report any issues that arise.

There is still additional work to be done to support rust-analyzer in the view! macro. The hoped-for improvements here are solely inside the #[component]body.

"""

diversable commented 9 months ago

addressed in Leptos commit #2052