Helper function to create [`Tokens`] from an iterator of (kind, range).
(tokens: impl Iterator<Item = (TokenKind, Range<u32>)>)
| 651 | |
| 652 | /// Helper function to create [`Tokens`] from an iterator of (kind, range). |
| 653 | fn new_tokens(tokens: impl Iterator<Item = (TokenKind, Range<u32>)>) -> Tokens { |
| 654 | Tokens::new( |
| 655 | tokens |
| 656 | .map(|(kind, range)| { |
| 657 | Token::new( |
| 658 | kind, |
| 659 | TextRange::new(TextSize::new(range.start), TextSize::new(range.end)), |
| 660 | TokenFlags::empty(), |
| 661 | ) |
| 662 | }) |
| 663 | .collect(), |
| 664 | ) |
| 665 | } |
| 666 | |
| 667 | #[test] |
| 668 | fn tokens_after_offset_at_token_start() { |