I'd like to attach a diagnostic to a specific token in an attribute. This token is not its own syntax node, since it's just part of the attributes
Is there any existing way to accomplish this? I don't see any, since diagnostics are always attached to
SyntaxNodePtrs, which only work for nodes, not
on the IDE level the diagnostic just has a TextRange, so it should be possible to narrow the range during diagnostic collection there. You could use the token ID of the token in the tree in the HIR diagnostic, I guess?
hmm, yeah, that's right
Yeah, the idea is that diagnostic struct are more semantic-based, and that rendering them into specific ranges is handled by an IDE. It might make sense to document that somewhere though.