aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
authorEdwin Cheng <[email protected]>2019-12-18 03:36:10 +0000
committerEdwin Cheng <[email protected]>2019-12-18 03:36:10 +0000
commit2ea1cfd7804dd57d63196e71f66c22e56cfd79a8 (patch)
tree03d6396cb4536513807932c5de69b9f2cf1b8cba /crates/ra_mbe
parente16f3a5ee2f7df3f42827f3f279b5ed6774bde8e (diff)
Rename range to by_kind
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r--crates/ra_mbe/src/syntax_bridge.rs2
-rw-r--r--crates/ra_mbe/src/tests.rs2
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
21impl TokenTextRange { 21impl 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);