From 489ae7a800b02dbdacc1f949c067fa557333e7a1 Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 24 May 2021 20:29:48 +0200 Subject: Make `TokenTextRange` private --- crates/hir_expand/src/db.rs | 2 +- crates/hir_expand/src/hygiene.rs | 2 +- crates/hir_expand/src/lib.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'crates/hir_expand') diff --git a/crates/hir_expand/src/db.rs b/crates/hir_expand/src/db.rs index 5c769c1bf..03637878b 100644 --- a/crates/hir_expand/src/db.rs +++ b/crates/hir_expand/src/db.rs @@ -155,7 +155,7 @@ pub fn expand_hypothetical( mbe::token_tree_to_syntax_node(&hypothetical_expansion.value, fragment_kind).ok()?; let token_id = macro_def.map_id_down(token_id); - let range = tmap_2.range_by_token(token_id)?.by_kind(token_to_map.kind())?; + let range = tmap_2.range_by_token(token_id, token_to_map.kind())?; let token = node.syntax_node().covering_element(range).into_token()?; Some((node.syntax_node(), token)) } diff --git a/crates/hir_expand/src/hygiene.rs b/crates/hir_expand/src/hygiene.rs index 38e09fdd4..d98913907 100644 --- a/crates/hir_expand/src/hygiene.rs +++ b/crates/hir_expand/src/hygiene.rs @@ -154,7 +154,7 @@ impl HygieneInfo { }, }; - let range = token_map.range_by_token(token_id)?.by_kind(SyntaxKind::IDENT)?; + let range = token_map.range_by_token(token_id, SyntaxKind::IDENT)?; Some((tt.with_value(range + tt.value), origin)) } } diff --git a/crates/hir_expand/src/lib.rs b/crates/hir_expand/src/lib.rs index 92c679dd2..6be4516a3 100644 --- a/crates/hir_expand/src/lib.rs +++ b/crates/hir_expand/src/lib.rs @@ -329,7 +329,7 @@ impl ExpansionInfo { let token_id = self.macro_arg.1.token_by_range(range)?; let token_id = self.macro_def.map_id_down(token_id); - let range = self.exp_map.range_by_token(token_id)?.by_kind(token.value.kind())?; + let range = self.exp_map.range_by_token(token_id, token.value.kind())?; let token = self.expanded.value.covering_element(range).into_token()?; @@ -354,7 +354,7 @@ impl ExpansionInfo { }, }; - let range = token_map.range_by_token(token_id)?.by_kind(token.value.kind())?; + let range = token_map.range_by_token(token_id, token.value.kind())?; let token = tt.value.covering_element(range + tt.value.text_range().start()).into_token()?; Some((tt.with_value(token), origin)) -- cgit v1.2.3