mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Fix the eager token maps by re-mapping the textranges between the input and input expansion
This commit is contained in:
parent
2366c16bf9
commit
6a7b905c86
18 changed files with 434 additions and 157 deletions
|
@ -110,4 +110,11 @@ impl TokenMap {
|
|||
// FIXME: This could be accidentally quadratic
|
||||
self.entries.remove(idx);
|
||||
}
|
||||
|
||||
pub fn entries(&self) -> impl Iterator<Item = (tt::TokenId, TextRange)> + '_ {
|
||||
self.entries.iter().filter_map(|&(tid, tr)| match tr {
|
||||
TokenTextRange::Token(range) => Some((tid, range)),
|
||||
TokenTextRange::Delimiter(_) => None,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue