aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_syntax/src')
-rw-r--r--crates/ra_syntax/src/algo.rs3
-rw-r--r--crates/ra_syntax/src/parsing/reparsing.rs3
-rw-r--r--crates/ra_syntax/src/syntax_node.rs8
3 files changed, 6 insertions, 8 deletions
diff --git a/crates/ra_syntax/src/algo.rs b/crates/ra_syntax/src/algo.rs
index e4061e994..2b2b295f9 100644
--- a/crates/ra_syntax/src/algo.rs
+++ b/crates/ra_syntax/src/algo.rs
@@ -214,8 +214,7 @@ fn with_children(
214 new_children: Vec<NodeOrToken<rowan::GreenNode, rowan::GreenToken>>, 214 new_children: Vec<NodeOrToken<rowan::GreenNode, rowan::GreenToken>>,
215) -> SyntaxNode { 215) -> SyntaxNode {
216 let len = new_children.iter().map(|it| it.text_len()).sum::<TextUnit>(); 216 let len = new_children.iter().map(|it| it.text_len()).sum::<TextUnit>();
217 let new_node = 217 let new_node = rowan::GreenNode::new(rowan::SyntaxKind(parent.kind() as u16), new_children);
218 rowan::GreenNode::new(rowan::cursor::SyntaxKind(parent.kind() as u16), new_children);
219 let new_root_node = parent.replace_with(new_node); 218 let new_root_node = parent.replace_with(new_node);
220 let new_root_node = SyntaxNode::new_root(new_root_node); 219 let new_root_node = SyntaxNode::new_root(new_root_node);
221 220
diff --git a/crates/ra_syntax/src/parsing/reparsing.rs b/crates/ra_syntax/src/parsing/reparsing.rs
index 65b8aa10d..06bdda11d 100644
--- a/crates/ra_syntax/src/parsing/reparsing.rs
+++ b/crates/ra_syntax/src/parsing/reparsing.rs
@@ -70,8 +70,7 @@ fn reparse_token<'node>(
70 } 70 }
71 } 71 }
72 72
73 let new_token = 73 let new_token = GreenToken::new(rowan::SyntaxKind(token.kind().into()), text.into());
74 GreenToken::new(rowan::cursor::SyntaxKind(token.kind().into()), text.into());
75 Some((token.replace_with(new_token), token.text_range())) 74 Some((token.replace_with(new_token), token.text_range()))
76 } 75 }
77 _ => None, 76 _ => None,
diff --git a/crates/ra_syntax/src/syntax_node.rs b/crates/ra_syntax/src/syntax_node.rs
index 041c6ea8d..b3eb5da63 100644
--- a/crates/ra_syntax/src/syntax_node.rs
+++ b/crates/ra_syntax/src/syntax_node.rs
@@ -21,18 +21,18 @@ pub enum RustLanguage {}
21impl Language for RustLanguage { 21impl Language for RustLanguage {
22 type Kind = SyntaxKind; 22 type Kind = SyntaxKind;
23 23
24 fn kind_from_raw(raw: rowan::cursor::SyntaxKind) -> SyntaxKind { 24 fn kind_from_raw(raw: rowan::SyntaxKind) -> SyntaxKind {
25 SyntaxKind::from(raw.0) 25 SyntaxKind::from(raw.0)
26 } 26 }
27 27
28 fn kind_to_raw(kind: SyntaxKind) -> rowan::cursor::SyntaxKind { 28 fn kind_to_raw(kind: SyntaxKind) -> rowan::SyntaxKind {
29 rowan::cursor::SyntaxKind(kind.into()) 29 rowan::SyntaxKind(kind.into())
30 } 30 }
31} 31}
32 32
33pub type SyntaxNode = rowan::SyntaxNode<RustLanguage>; 33pub type SyntaxNode = rowan::SyntaxNode<RustLanguage>;
34pub type SyntaxToken = rowan::SyntaxToken<RustLanguage>; 34pub type SyntaxToken = rowan::SyntaxToken<RustLanguage>;
35pub type SyntaxElement = rowan::NodeOrToken<SyntaxNode, SyntaxToken>; 35pub type SyntaxElement = rowan::SyntaxElement<RustLanguage>;
36pub type SyntaxNodeChildren = rowan::SyntaxNodeChildren<RustLanguage>; 36pub type SyntaxNodeChildren = rowan::SyntaxNodeChildren<RustLanguage>;
37pub type SyntaxElementChildren = rowan::SyntaxElementChildren<RustLanguage>; 37pub type SyntaxElementChildren = rowan::SyntaxElementChildren<RustLanguage>;
38 38