aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/ra_assists/Cargo.toml1
-rw-r--r--crates/ra_cargo_watch/Cargo.toml3
-rw-r--r--crates/ra_hir/src/semantics.rs13
-rw-r--r--crates/ra_hir_def/Cargo.toml1
-rw-r--r--crates/ra_ide/Cargo.toml3
-rw-r--r--crates/ra_ide/src/extend_selection.rs8
-rw-r--r--crates/ra_ide_db/Cargo.toml12
-rw-r--r--crates/ra_prof/Cargo.toml1
-rw-r--r--crates/ra_text_edit/Cargo.toml4
-rw-r--r--crates/rust-analyzer/Cargo.toml1
-rw-r--r--crates/test_utils/Cargo.toml2
11 files changed, 6 insertions, 43 deletions
diff --git a/crates/ra_assists/Cargo.toml b/crates/ra_assists/Cargo.toml
index 12a933645..d314dc8e6 100644
--- a/crates/ra_assists/Cargo.toml
+++ b/crates/ra_assists/Cargo.toml
@@ -11,7 +11,6 @@ doctest = false
11format-buf = "1.0.0" 11format-buf = "1.0.0"
12join_to_string = "0.1.3" 12join_to_string = "0.1.3"
13rustc-hash = "1.1.0" 13rustc-hash = "1.1.0"
14either = "1.5.3"
15 14
16ra_syntax = { path = "../ra_syntax" } 15ra_syntax = { path = "../ra_syntax" }
17ra_text_edit = { path = "../ra_text_edit" } 16ra_text_edit = { path = "../ra_text_edit" }
diff --git a/crates/ra_cargo_watch/Cargo.toml b/crates/ra_cargo_watch/Cargo.toml
index 989ccc097..1fdbffea1 100644
--- a/crates/ra_cargo_watch/Cargo.toml
+++ b/crates/ra_cargo_watch/Cargo.toml
@@ -9,10 +9,7 @@ crossbeam-channel = "0.4.0"
9lsp-types = { version = "0.71.0", features = ["proposed"] } 9lsp-types = { version = "0.71.0", features = ["proposed"] }
10log = "0.4.8" 10log = "0.4.8"
11cargo_metadata = "0.9.1" 11cargo_metadata = "0.9.1"
12jod-thread = "0.1.0"
13parking_lot = "0.10.0"
14serde_json = "1.0.48" 12serde_json = "1.0.48"
15 13
16[dev-dependencies] 14[dev-dependencies]
17insta = "0.13.1" 15insta = "0.13.1"
18serde_json = "1.0.48"
diff --git a/crates/ra_hir/src/semantics.rs b/crates/ra_hir/src/semantics.rs
index 5b0b94e34..c3d8ee1ae 100644
--- a/crates/ra_hir/src/semantics.rs
+++ b/crates/ra_hir/src/semantics.rs
@@ -388,7 +388,7 @@ fn original_range_and_origin(
388 let single = skip_trivia_token(node.value.first_token()?, Direction::Next)? 388 let single = skip_trivia_token(node.value.first_token()?, Direction::Next)?
389 == skip_trivia_token(node.value.last_token()?, Direction::Prev)?; 389 == skip_trivia_token(node.value.last_token()?, Direction::Prev)?;
390 390
391 return Some(node.value.descendants().find_map(|it| { 391 Some(node.value.descendants().find_map(|it| {
392 let first = skip_trivia_token(it.first_token()?, Direction::Next)?; 392 let first = skip_trivia_token(it.first_token()?, Direction::Next)?;
393 let last = skip_trivia_token(it.last_token()?, Direction::Prev)?; 393 let last = skip_trivia_token(it.last_token()?, Direction::Prev)?;
394 394
@@ -404,16 +404,9 @@ fn original_range_and_origin(
404 return None; 404 return None;
405 } 405 }
406 406
407 // FIXME: Add union method in TextRange
408 Some(( 407 Some((
409 first.with_value(union_range(first.value.text_range(), last.value.text_range())), 408 first.with_value(first.value.text_range().extend_to(&last.value.text_range())),
410 first_origin, 409 first_origin,
411 )) 410 ))
412 })?); 411 })?)
413
414 fn union_range(a: TextRange, b: TextRange) -> TextRange {
415 let start = a.start().min(b.start());
416 let end = a.end().max(b.end());
417 TextRange::from_to(start, end)
418 }
419} 412}
diff --git a/crates/ra_hir_def/Cargo.toml b/crates/ra_hir_def/Cargo.toml
index 5053d0688..fa25cc4fb 100644
--- a/crates/ra_hir_def/Cargo.toml
+++ b/crates/ra_hir_def/Cargo.toml
@@ -14,7 +14,6 @@ rustc-hash = "1.1.0"
14either = "1.5.3" 14either = "1.5.3"
15anymap = "0.12.1" 15anymap = "0.12.1"
16drop_bomb = "0.1.4" 16drop_bomb = "0.1.4"
17itertools = "0.8.2"
18 17
19ra_arena = { path = "../ra_arena" } 18ra_arena = { path = "../ra_arena" }
20ra_db = { path = "../ra_db" } 19ra_db = { path = "../ra_db" }
diff --git a/crates/ra_ide/Cargo.toml b/crates/ra_ide/Cargo.toml
index 6a3112f9c..7625fc8c8 100644
--- a/crates/ra_ide/Cargo.toml
+++ b/crates/ra_ide/Cargo.toml
@@ -17,10 +17,7 @@ indexmap = "1.3.2"
17itertools = "0.8.2" 17itertools = "0.8.2"
18join_to_string = "0.1.3" 18join_to_string = "0.1.3"
19log = "0.4.8" 19log = "0.4.8"
20rayon = "1.3.0"
21fst = { version = "0.3.5", default-features = false }
22rustc-hash = "1.1.0" 20rustc-hash = "1.1.0"
23superslice = "1.0.0"
24rand = { version = "0.7.3", features = ["small_rng"] } 21rand = { version = "0.7.3", features = ["small_rng"] }
25once_cell = "1.3.1" 22once_cell = "1.3.1"
26 23
diff --git a/crates/ra_ide/src/extend_selection.rs b/crates/ra_ide/src/extend_selection.rs
index 2e09bd1ec..f5a063351 100644
--- a/crates/ra_ide/src/extend_selection.rs
+++ b/crates/ra_ide/src/extend_selection.rs
@@ -161,7 +161,7 @@ fn extend_tokens_from_range(
161 .take_while(validate) 161 .take_while(validate)
162 .last()?; 162 .last()?;
163 163
164 let range = union_range(first.text_range(), last.text_range()); 164 let range = first.text_range().extend_to(&last.text_range());
165 if original_range.is_subrange(&range) && original_range != range { 165 if original_range.is_subrange(&range) && original_range != range {
166 Some(range) 166 Some(range)
167 } else { 167 } else {
@@ -169,12 +169,6 @@ fn extend_tokens_from_range(
169 } 169 }
170} 170}
171 171
172fn union_range(range: TextRange, r: TextRange) -> TextRange {
173 let start = range.start().min(r.start());
174 let end = range.end().max(r.end());
175 TextRange::from_to(start, end)
176}
177
178/// Find the shallowest node with same range, which allows us to traverse siblings. 172/// Find the shallowest node with same range, which allows us to traverse siblings.
179fn shallowest_node(node: &SyntaxNode) -> SyntaxNode { 173fn shallowest_node(node: &SyntaxNode) -> SyntaxNode {
180 node.ancestors().take_while(|n| n.text_range() == node.text_range()).last().unwrap() 174 node.ancestors().take_while(|n| n.text_range() == node.text_range()).last().unwrap()
diff --git a/crates/ra_ide_db/Cargo.toml b/crates/ra_ide_db/Cargo.toml
index 2f5b74b92..7b285d280 100644
--- a/crates/ra_ide_db/Cargo.toml
+++ b/crates/ra_ide_db/Cargo.toml
@@ -11,29 +11,17 @@ doctest = false
11wasm = [] 11wasm = []
12 12
13[dependencies] 13[dependencies]
14either = "1.5.3"
15format-buf = "1.0.0"
16indexmap = "1.3.2"
17itertools = "0.8.2"
18join_to_string = "0.1.3"
19log = "0.4.8" 14log = "0.4.8"
20rayon = "1.3.0" 15rayon = "1.3.0"
21fst = { version = "0.3.5", default-features = false } 16fst = { version = "0.3.5", default-features = false }
22rustc-hash = "1.1.0" 17rustc-hash = "1.1.0"
23superslice = "1.0.0" 18superslice = "1.0.0"
24once_cell = "1.3.1"
25 19
26ra_syntax = { path = "../ra_syntax" } 20ra_syntax = { path = "../ra_syntax" }
27ra_text_edit = { path = "../ra_text_edit" } 21ra_text_edit = { path = "../ra_text_edit" }
28ra_db = { path = "../ra_db" } 22ra_db = { path = "../ra_db" }
29ra_cfg = { path = "../ra_cfg" }
30ra_fmt = { path = "../ra_fmt" }
31ra_prof = { path = "../ra_prof" } 23ra_prof = { path = "../ra_prof" }
32test_utils = { path = "../test_utils" }
33 24
34# ra_ide should depend only on the top-level `hir` package. if you need 25# ra_ide should depend only on the top-level `hir` package. if you need
35# something from some `hir_xxx` subpackage, reexport the API via `hir`. 26# something from some `hir_xxx` subpackage, reexport the API via `hir`.
36hir = { path = "../ra_hir", package = "ra_hir" } 27hir = { path = "../ra_hir", package = "ra_hir" }
37
38[dev-dependencies]
39insta = "0.13.1"
diff --git a/crates/ra_prof/Cargo.toml b/crates/ra_prof/Cargo.toml
index 823745795..d15b08992 100644
--- a/crates/ra_prof/Cargo.toml
+++ b/crates/ra_prof/Cargo.toml
@@ -10,7 +10,6 @@ doctest = false
10 10
11[dependencies] 11[dependencies]
12once_cell = "1.3.1" 12once_cell = "1.3.1"
13itertools = "0.8.2"
14backtrace = { version = "0.3.44", optional = true } 13backtrace = { version = "0.3.44", optional = true }
15 14
16[target.'cfg(not(target_env = "msvc"))'.dependencies] 15[target.'cfg(not(target_env = "msvc"))'.dependencies]
diff --git a/crates/ra_text_edit/Cargo.toml b/crates/ra_text_edit/Cargo.toml
index a32149299..cae28389d 100644
--- a/crates/ra_text_edit/Cargo.toml
+++ b/crates/ra_text_edit/Cargo.toml
@@ -9,7 +9,5 @@ publish = false
9doctest = false 9doctest = false
10 10
11[dependencies] 11[dependencies]
12text_unit = "0.1.9" 12text_unit = "0.1.10"
13 13
14[dev-dependencies]
15test_utils = { path = "../test_utils" }
diff --git a/crates/rust-analyzer/Cargo.toml b/crates/rust-analyzer/Cargo.toml
index 2cd39b7be..d00545121 100644
--- a/crates/rust-analyzer/Cargo.toml
+++ b/crates/rust-analyzer/Cargo.toml
@@ -15,7 +15,6 @@ path = "./src/bin/main.rs"
15[dependencies] 15[dependencies]
16anyhow = "1.0.26" 16anyhow = "1.0.26"
17crossbeam-channel = "0.4.0" 17crossbeam-channel = "0.4.0"
18either = "1.5.3"
19env_logger = { version = "0.7.1", default-features = false } 18env_logger = { version = "0.7.1", default-features = false }
20globset = "0.4.4" 19globset = "0.4.4"
21itertools = "0.8.2" 20itertools = "0.8.2"
diff --git a/crates/test_utils/Cargo.toml b/crates/test_utils/Cargo.toml
index 971592b73..6a7c6d6f9 100644
--- a/crates/test_utils/Cargo.toml
+++ b/crates/test_utils/Cargo.toml
@@ -9,5 +9,5 @@ doctest = false
9 9
10[dependencies] 10[dependencies]
11difference = "2.0.0" 11difference = "2.0.0"
12text_unit = "0.1.9" 12text_unit = "0.1.10"
13serde_json = "1.0.48" 13serde_json = "1.0.48"