mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
Record macro def site spans
This commit is contained in:
parent
51a9e7831a
commit
7d762d18ed
3 changed files with 16 additions and 3 deletions
|
@ -38,6 +38,10 @@ impl mbe::SpanMapper<Span> for SpanMapRef<'_> {
|
|||
impl SpanMap {
|
||||
pub fn span_for_range(&self, range: TextRange) -> Span {
|
||||
match self {
|
||||
// FIXME: Is it correct for us to only take the span at the start? This feels somewhat
|
||||
// wrong. The context will be right, but the range could be considered wrong. See
|
||||
// https://github.com/rust-lang/rust/issues/23480, we probably want to fetch the span at
|
||||
// the start and end, then merge them like rustc does in `Span::to
|
||||
Self::ExpansionSpanMap(span_map) => span_map.span_at(range.start()),
|
||||
Self::RealSpanMap(span_map) => span_map.span_for_range(range),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue