I've noticed that some property macros are highlighted and formatted correctly, but others are not. I tried using syn to parse all the tokens (instead of converting attributes to strings and parsing them myself), but it didn't work.
I think this is not an editor issue but a question of how to please rust-analyzer. Because if I use syn to resolve the attribute to Ident, then ra will give completion for ident. Maybe I should go to ra and ask the relevant developers.
I think rust-analyzer looks at how the tokens are used, so if the output uses some tokens as a path to a type, it may get highlited as that kind of type. You need to preserve the spans, though, as far as I know.