mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
internal: Filter out opaque tokens in some of IDE feature macro descensions
This commit is contained in:
parent
ac4edbf9dc
commit
24d65bb7cf
11 changed files with 114 additions and 70 deletions
|
@ -55,7 +55,10 @@ where
|
|||
/// Returns all [`TextRange`]s that correspond to the given span.
|
||||
///
|
||||
/// Note this does a linear search through the entire backing vector.
|
||||
pub fn ranges_with_span_exact(&self, span: SpanData<S>) -> impl Iterator<Item = TextRange> + '_
|
||||
pub fn ranges_with_span_exact(
|
||||
&self,
|
||||
span: SpanData<S>,
|
||||
) -> impl Iterator<Item = (TextRange, S)> + '_
|
||||
where
|
||||
S: Copy,
|
||||
{
|
||||
|
@ -64,14 +67,14 @@ where
|
|||
return None;
|
||||
}
|
||||
let start = idx.checked_sub(1).map_or(TextSize::new(0), |prev| self.spans[prev].0);
|
||||
Some(TextRange::new(start, end))
|
||||
Some((TextRange::new(start, end), s.ctx))
|
||||
})
|
||||
}
|
||||
|
||||
/// Returns all [`TextRange`]s whose spans contain the given span.
|
||||
///
|
||||
/// Note this does a linear search through the entire backing vector.
|
||||
pub fn ranges_with_span(&self, span: SpanData<S>) -> impl Iterator<Item = TextRange> + '_
|
||||
pub fn ranges_with_span(&self, span: SpanData<S>) -> impl Iterator<Item = (TextRange, S)> + '_
|
||||
where
|
||||
S: Copy,
|
||||
{
|
||||
|
@ -83,7 +86,7 @@ where
|
|||
return None;
|
||||
}
|
||||
let start = idx.checked_sub(1).map_or(TextSize::new(0), |prev| self.spans[prev].0);
|
||||
Some(TextRange::new(start, end))
|
||||
Some((TextRange::new(start, end), s.ctx))
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue