]> git.lizzy.rs Git - rust.git/commitdiff
:arrow_up: rowan
authorAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 4 Dec 2019 16:15:55 +0000 (17:15 +0100)
committerAleksey Kladov <aleksey.kladov@gmail.com>
Wed, 4 Dec 2019 16:15:55 +0000 (17:15 +0100)
Cargo.lock
Cargo.toml
crates/ra_syntax/Cargo.toml
crates/ra_syntax/src/algo.rs
crates/ra_syntax/src/syntax_node.rs

index 23c9e25436b078dbe3e08d5dbdb1f669b235b133..2cb9ae76db769139bd4948cffd3b918f5f058037 100644 (file)
@@ -1121,7 +1121,7 @@ dependencies = [
  "once_cell 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "ra_parser 0.1.0",
  "ra_text_edit 0.1.0",
- "rowan 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "rowan 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "rustc_lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "smol_str 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1386,7 +1386,7 @@ dependencies = [
 
 [[package]]
 name = "rowan"
-version = "0.7.1"
+version = "0.8.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1903,7 +1903,7 @@ dependencies = [
 "checksum relative-path 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bedde000f40f2921ce439ea165c9c53fd629bfa115140c72e22aceacb4a21954"
 "checksum remove_dir_all 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e"
 "checksum ron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2ece421e0c4129b90e4a35b6f625e472e96c552136f5093a2f4fa2bbb75a62d5"
-"checksum rowan 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ca620bbf9c48c92b5cef19f96354a309ac36b7d8ef7c591e66117335c8b1988b"
+"checksum rowan 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2662e5d6084ef5367e7410e730b4ad7393ccfaa57974e9734c73e1669db935c0"
 "checksum rustc-demangle 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783"
 "checksum rustc-hash 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7540fc8b0c49f096ee9c961cda096467dce8084bec6bdca2fc83895fd9b28cb8"
 "checksum rustc_lexer 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c86aae0c77166108c01305ee1a36a1e77289d7dc6ca0a3cd91ff4992de2d16a5"
index 92e3228f05224a9d9510eb109e16e1a9b22f7b19..97508c57b4f6e0de73c9b0aaab5fd6cd4f3824b7 100644 (file)
@@ -11,3 +11,4 @@ incremental = true
 debug = 0 # set this to 1 or 2 to get more useful backtraces in debugger
 
 [patch.'crates-io']
+# rowan = { path = "../rowan" }
\ No newline at end of file
index 5db2b58c0bd672f2ab0093617697ddf59dc94325..1c0b184e1f81dd66ce98d410099a3d46fce20bdc 100644 (file)
@@ -12,7 +12,7 @@ doctest = false
 
 [dependencies]
 itertools = "0.8.0"
-rowan = "0.7.0"
+rowan = "0.8.0"
 rustc_lexer = "0.1.0"
 rustc-hash = "1.0.1"
 arrayvec = "0.5.1"
index 1c075082a4ac771cb3298c38f6c3e7d344efff20..e4061e994705194806ccae5c8243125c8d054728 100644 (file)
@@ -140,13 +140,13 @@ pub fn insert_children(
     });
 
     let new_children = match &position {
-        InsertPosition::First => to_insert.chain(old_children).collect::<Box<[_]>>(),
-        InsertPosition::Last => old_children.chain(to_insert).collect::<Box<[_]>>(),
+        InsertPosition::First => to_insert.chain(old_children).collect::<Vec<_>>(),
+        InsertPosition::Last => old_children.chain(to_insert).collect::<Vec<_>>(),
         InsertPosition::Before(anchor) | InsertPosition::After(anchor) => {
             let take_anchor = if let InsertPosition::After(_) = position { 1 } else { 0 };
             let split_at = position_of_child(parent, anchor.clone()) + take_anchor;
             let before = old_children.by_ref().take(split_at).collect::<Vec<_>>();
-            before.into_iter().chain(to_insert).chain(old_children).collect::<Box<[_]>>()
+            before.into_iter().chain(to_insert).chain(old_children).collect::<Vec<_>>()
         }
     };
 
@@ -174,7 +174,7 @@ pub fn replace_children(
         .into_iter()
         .chain(to_insert.map(to_green_element))
         .chain(old_children.skip(end + 1 - start))
-        .collect::<Box<[_]>>();
+        .collect::<Vec<_>>();
     with_children(parent, new_children)
 }
 
@@ -187,7 +187,7 @@ pub fn replace_descendants(
     map: &FxHashMap<SyntaxElement, SyntaxElement>,
 ) -> SyntaxNode {
     //  FIXME: this could be made much faster.
-    let new_children = parent.children_with_tokens().map(|it| go(map, it)).collect::<Box<[_]>>();
+    let new_children = parent.children_with_tokens().map(|it| go(map, it)).collect::<Vec<_>>();
     return with_children(parent, new_children);
 
     fn go(
@@ -211,7 +211,7 @@ fn go(
 
 fn with_children(
     parent: &SyntaxNode,
-    new_children: Box<[NodeOrToken<rowan::GreenNode, rowan::GreenToken>]>,
+    new_children: Vec<NodeOrToken<rowan::GreenNode, rowan::GreenToken>>,
 ) -> SyntaxNode {
     let len = new_children.iter().map(|it| it.text_len()).sum::<TextUnit>();
     let new_node =
index b2f5b8c6469a5ca24bc7613444bdf5125816ce70..041c6ea8d6359d86372ad691c6c2cabee3f0fb11 100644 (file)
@@ -40,7 +40,7 @@ fn kind_to_raw(kind: SyntaxKind) -> rowan::cursor::SyntaxKind {
 
 pub struct SyntaxTreeBuilder {
     errors: Vec<SyntaxError>,
-    inner: GreenNodeBuilder,
+    inner: GreenNodeBuilder<'static>,
 }
 
 impl Default for SyntaxTreeBuilder {