diff options
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r-- | crates/ra_mbe/src/syntax_bridge.rs | 2 | ||||
-rw-r--r-- | crates/ra_mbe/src/tests.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index 44a51b7a5..d585d57af 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs | |||
@@ -19,7 +19,7 @@ pub enum TokenTextRange { | |||
19 | } | 19 | } |
20 | 20 | ||
21 | impl TokenTextRange { | 21 | impl TokenTextRange { |
22 | pub fn range(self, kind: SyntaxKind) -> Option<TextRange> { | 22 | pub fn by_kind(self, kind: SyntaxKind) -> Option<TextRange> { |
23 | match self { | 23 | match self { |
24 | TokenTextRange::Token(it) => Some(it), | 24 | TokenTextRange::Token(it) => Some(it), |
25 | TokenTextRange::Delimiter(open, close) => match kind { | 25 | TokenTextRange::Delimiter(open, close) => match kind { |
diff --git a/crates/ra_mbe/src/tests.rs b/crates/ra_mbe/src/tests.rs index ae7f3dfd4..ff225f0db 100644 --- a/crates/ra_mbe/src/tests.rs +++ b/crates/ra_mbe/src/tests.rs | |||
@@ -102,7 +102,7 @@ macro_rules! foobar { | |||
102 | let (expansion, (token_map, content)) = expand_and_map(&rules, "foobar!(baz);"); | 102 | let (expansion, (token_map, content)) = expand_and_map(&rules, "foobar!(baz);"); |
103 | 103 | ||
104 | let get_text = |id, kind| -> String { | 104 | let get_text = |id, kind| -> String { |
105 | content[token_map.range_by_token(id).unwrap().range(kind).unwrap()].to_string() | 105 | content[token_map.range_by_token(id).unwrap().by_kind(kind).unwrap()].to_string() |
106 | }; | 106 | }; |
107 | 107 | ||
108 | assert_eq!(expansion.token_trees.len(), 4); | 108 | assert_eq!(expansion.token_trees.len(), 4); |