aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-01-09 15:20:05 +0000
committerAleksey Kladov <[email protected]>2020-01-09 15:33:02 +0000
commit47785b0cd4f6ea759ffcf87af453962bcf5053f1 (patch)
tree05de1b685066e7d07bde8da2ae5f2856ba35512c
parent2ffaad10f24ad9d3d748a347e02f170f24833ec3 (diff)
:arrow_up: rowan
-rw-r--r--Cargo.lock6
-rw-r--r--crates/ra_syntax/Cargo.toml2
-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
5 files changed, 10 insertions, 12 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c570e0c3c..ba9a201b9 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1137,7 +1137,7 @@ dependencies = [
1137 "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", 1137 "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
1138 "ra_parser 0.1.0", 1138 "ra_parser 0.1.0",
1139 "ra_text_edit 0.1.0", 1139 "ra_text_edit 0.1.0",
1140 "rowan 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", 1140 "rowan 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
1141 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 1141 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
1142 "rustc_lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", 1142 "rustc_lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
1143 "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)", 1143 "serde 1.0.104 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1393,7 +1393,7 @@ dependencies = [
1393 1393
1394[[package]] 1394[[package]]
1395name = "rowan" 1395name = "rowan"
1396version = "0.8.2" 1396version = "0.9.0"
1397source = "registry+https://github.com/rust-lang/crates.io-index" 1397source = "registry+https://github.com/rust-lang/crates.io-index"
1398dependencies = [ 1398dependencies = [
1399 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", 1399 "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1895,7 +1895,7 @@ dependencies = [
1895"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716" 1895"checksum regex-syntax 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "11a7e20d1cce64ef2fed88b66d347f88bd9babb82845b2b858f3edbf59a4f716"
1896"checksum relative-path 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bedde000f40f2921ce439ea165c9c53fd629bfa115140c72e22aceacb4a21954" 1896"checksum relative-path 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bedde000f40f2921ce439ea165c9c53fd629bfa115140c72e22aceacb4a21954"
1897"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" 1897"checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e"
1898"checksum rowan 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3eb10a10a48f0f809a217bcf074b85a03dcf79831bae80e7f1a043d0897463e2" 1898"checksum rowan 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d03d4eff7a4e8dcc362e4c06bb2b1b33af4bcd64336c7f40a31a05850336b6c"
1899"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" 1899"checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
1900"checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8" 1900"checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
1901"checksum rustc_lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c86aae0c77166108c01305ee1a36a1e77289d7dc6ca0a3cd91ff4992de2d16a5" 1901"checksum rustc_lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c86aae0c77166108c01305ee1a36a1e77289d7dc6ca0a3cd91ff4992de2d16a5"
diff --git a/crates/ra_syntax/Cargo.toml b/crates/ra_syntax/Cargo.toml
index b6ebb129d..c5a3d1999 100644
--- a/crates/ra_syntax/Cargo.toml
+++ b/crates/ra_syntax/Cargo.toml
@@ -12,7 +12,7 @@ doctest = false
12 12
13[dependencies] 13[dependencies]
14itertools = "0.8.0" 14itertools = "0.8.0"
15rowan = "0.8.0" 15rowan = "0.9.0"
16rustc_lexer = "0.1.0" 16rustc_lexer = "0.1.0"
17rustc-hash = "1.0.1" 17rustc-hash = "1.0.1"
18arrayvec = "0.5.1" 18arrayvec = "0.5.1"
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