aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
committerAleksey Kladov <[email protected]>2019-07-20 10:58:27 +0100
commitf3bdbec1b68fa0e20f0b7b6c6ef64e1507970b0d (patch)
treef2cb82f74d2d60d5351c3d7c4d8e7bce4d351cab /crates/ra_mbe
parent6d5d82e412dea19ea48eecc6f7d5a4aa223a9599 (diff)
rename range -> text_range
Diffstat (limited to 'crates/ra_mbe')
-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()