aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_syntax/src/lib.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-10-02 15:07:12 +0100
committerAleksey Kladov <[email protected]>2018-10-02 15:09:23 +0100
commita261a1836ba02a1c091c5165795dc165ca399a87 (patch)
treee8bab3ea497a8e7207a24e481361bdd56ed81eaa /crates/ra_syntax/src/lib.rs
parentcd9c5f4ab205e092b87be6affe6d7e78d877dbf0 (diff)
Move to rowan for syntax tree impl
Diffstat (limited to 'crates/ra_syntax/src/lib.rs')
-rw-r--r--crates/ra_syntax/src/lib.rs13
1 files changed, 5 insertions, 8 deletions
diff --git a/crates/ra_syntax/src/lib.rs b/crates/ra_syntax/src/lib.rs
index eb271762e..c7eda4563 100644
--- a/crates/ra_syntax/src/lib.rs
+++ b/crates/ra_syntax/src/lib.rs
@@ -24,8 +24,7 @@ extern crate itertools;
24extern crate unicode_xid; 24extern crate unicode_xid;
25extern crate drop_bomb; 25extern crate drop_bomb;
26extern crate parking_lot; 26extern crate parking_lot;
27extern crate smol_str; 27extern crate rowan;
28extern crate text_unit;
29 28
30#[cfg(test)] 29#[cfg(test)]
31#[macro_use] 30#[macro_use]
@@ -48,8 +47,7 @@ pub mod utils;
48pub mod text_utils; 47pub mod text_utils;
49 48
50pub use { 49pub use {
51 text_unit::{TextRange, TextUnit}, 50 rowan::{SmolStr, TextRange, TextUnit},
52 smol_str::SmolStr,
53 ast::AstNode, 51 ast::AstNode,
54 lexer::{tokenize, Token}, 52 lexer::{tokenize, Token},
55 syntax_kinds::SyntaxKind, 53 syntax_kinds::SyntaxKind,
@@ -58,7 +56,7 @@ pub use {
58}; 56};
59 57
60use { 58use {
61 yellow::{GreenNode, SyntaxRoot}, 59 yellow::{GreenNode},
62}; 60};
63 61
64#[derive(Clone, Debug, Hash)] 62#[derive(Clone, Debug, Hash)]
@@ -68,8 +66,7 @@ pub struct File {
68 66
69impl File { 67impl File {
70 fn new(green: GreenNode, errors: Vec<SyntaxError>) -> File { 68 fn new(green: GreenNode, errors: Vec<SyntaxError>) -> File {
71 let root = SyntaxRoot::new(green, errors); 69 let root = SyntaxNode::new(green, errors);
72 let root = SyntaxNode::new_owned(root);
73 if cfg!(debug_assertions) { 70 if cfg!(debug_assertions) {
74 utils::validate_block_structure(root.borrowed()); 71 utils::validate_block_structure(root.borrowed());
75 } 72 }
@@ -100,6 +97,6 @@ impl File {
100 self.root.borrowed() 97 self.root.borrowed()
101 } 98 }
102 pub fn errors(&self) -> Vec<SyntaxError> { 99 pub fn errors(&self) -> Vec<SyntaxError> {
103 self.syntax().root.syntax_root().errors.clone() 100 self.root.root_data().clone()
104 } 101 }
105} 102}