Skip to content

How to please ra for a better attribute macro experience? #15570

Closed Answered by flodiebold
cathaysia asked this question in Q&A
Discussion options

You must be logged in to vote

If I read your example right, your second example where the completion doesn't work doesn't use the attribute contents. The way that RA understands what the tokens inside the attribute parentheses mean is by looking at the expanded result. If e.g. the token in the macro input shows up in the macro expansion as a type name (with a span referring to the original token from the input), RA knows that it's a type and can show corresponding completions. If the token isn't used, it means nothing and RA can't provide completions.

For your last example, it's worth noting that RA can only provide completion if the macro actually expands. If you have something like #[convert_to([let abc = ])], syn w…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@flodiebold
Comment options

Answer selected by cathaysia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants