aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe/src/syntax_bridge.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_mbe/src/syntax_bridge.rs')
-rw-r--r--crates/ra_mbe/src/syntax_bridge.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs
index 64ed6a517..7ff0fc472 100644
--- a/crates/ra_mbe/src/syntax_bridge.rs
+++ b/crates/ra_mbe/src/syntax_bridge.rs
@@ -19,7 +19,7 @@ pub struct TokenMap {
19pub fn ast_to_token_tree(ast: &ast::TokenTree) -> Option<(tt::Subtree, TokenMap)> { 19pub fn ast_to_token_tree(ast: &ast::TokenTree) -> Option<(tt::Subtree, TokenMap)> {
20 let mut token_map = TokenMap::default(); 20 let mut token_map = TokenMap::default();
21 let node = ast.syntax(); 21 let node = ast.syntax();
22 let tt = convert_tt(&mut token_map, node.range().start(), node)?; 22 let tt = convert_tt(&mut token_map, node.text_range().start(), node)?;
23 Some((tt, token_map)) 23 Some((tt, token_map))
24} 24}
25 25
@@ -27,7 +27,7 @@ pub fn ast_to_token_tree(ast: &ast::TokenTree) -> Option<(tt::Subtree, TokenMap)
27/// will consume). 27/// will consume).
28pub fn syntax_node_to_token_tree(node: &SyntaxNode) -> Option<(tt::Subtree, TokenMap)> { 28pub fn syntax_node_to_token_tree(node: &SyntaxNode) -> Option<(tt::Subtree, TokenMap)> {
29 let mut token_map = TokenMap::default(); 29 let mut token_map = TokenMap::default();
30 let tt = convert_tt(&mut token_map, node.range().start(), node)?; 30 let tt = convert_tt(&mut token_map, node.text_range().start(), node)?;
31 Some((tt, token_map)) 31 Some((tt, token_map))
32} 32}
33 33
@@ -229,7 +229,7 @@ fn convert_tt(
229 || token.kind() == IDENT 229 || token.kind() == IDENT
230 || token.kind() == LIFETIME 230 || token.kind() == LIFETIME
231 { 231 {
232 let relative_range = token.range() - global_offset; 232 let relative_range = token.text_range() - global_offset;
233 let id = token_map.alloc(relative_range); 233 let id = token_map.alloc(relative_range);
234 let text = token.text().clone(); 234 let text = token.text().clone();
235 tt::Leaf::from(tt::Ident { text, id }).into() 235 tt::Leaf::from(tt::Ident { text, id }).into()