syn-rsx icon indicating copy to clipboard operation
syn-rsx copied to clipboard

Node method to get span for node value

Open stoically opened this issue 5 years ago • 2 comments

This probably requires a huge pattern match covering all syn::Expr

stoically avatar Sep 10 '20 07:09 stoically

IIUC this issue is about getting span for any NodeType possible for a whole node. Right now my code implements this with names' or values' span. However there is no way to specify a span for an empty fragment node other than something like Span::call_site(). Correct me if I am wrong.

zetanumbers avatar Jan 07 '21 14:01 zetanumbers

The idea for this issue was to get the span just for the value, which wouldn't work for nodes that don't have a value, like fragments.

Having a method for the whole node is a good idea, opened https://github.com/stoically/syn-rsx/issues/14 to track that.

stoically avatar Jan 07 '21 17:01 stoically

Getting the span for a node value is actually already possible by just calling the span method on the Expr.

stoically avatar Oct 22 '22 16:10 stoically