Closed gusinacio closed 3 weeks ago
Gonna try taking a stab at this in the next devtools-focused release!
FYI this discussion might be helpful https://github.com/rust-lang/rust-analyzer/discussions/15452
In particular this part:
That is, if your macro only gets partial input (let's say, a certain identifier is missing that you expect), then your macro should generate output that mostly resembles what it should be if the input was complete (instead of turning the entire output into a single
compile_error!(...)
invocation, as that will erase basically all the information the IDE could make use of.
The rsx
macro seems to return just a compile_error!(...)
when the parsing fails, which doesn't give IDEs enough informations for completition hints.
https://github.com/DioxusLabs/dioxus/pull/2421 Fixes autocomplete in rsx. We now autocomplete attributes, elements, and braces in rsx
Feature Request
Create an LSP implementation of rsx to auto-suggest all the properties available for rsx. Right now, rust-analyzer doesn't suggest any properties of rsx components. It's good to work with because the compiler gives good hints, but an LSP would be an awesome developer experience.
Implement Suggestion
Not really a suggestion, but maybe rust-analyzer exposes APIs that helps to get the correct suggestions for auto complete lsp.