aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Cargo.lock20
-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
12 files changed, 6 insertions, 63 deletions
diff --git a/Cargo.lock b/Cargo.lock
index e64c757aa..49fddef4b 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -906,7 +906,6 @@ version = "0.1.0"
906name = "ra_assists" 906name = "ra_assists"
907version = "0.1.0" 907version = "0.1.0"
908dependencies = [ 908dependencies = [
909 "either",
910 "format-buf", 909 "format-buf",
911 "join_to_string", 910 "join_to_string",
912 "ra_db", 911 "ra_db",
@@ -927,10 +926,8 @@ dependencies = [
927 "cargo_metadata", 926 "cargo_metadata",
928 "crossbeam-channel", 927 "crossbeam-channel",
929 "insta", 928 "insta",
930 "jod-thread",
931 "log", 929 "log",
932 "lsp-types", 930 "lsp-types",
933 "parking_lot",
934 "serde_json", 931 "serde_json",
935] 932]
936 933
@@ -988,7 +985,6 @@ dependencies = [
988 "drop_bomb", 985 "drop_bomb",
989 "either", 986 "either",
990 "insta", 987 "insta",
991 "itertools",
992 "log", 988 "log",
993 "once_cell", 989 "once_cell",
994 "ra_arena", 990 "ra_arena",
@@ -1046,7 +1042,6 @@ version = "0.1.0"
1046dependencies = [ 1042dependencies = [
1047 "either", 1043 "either",
1048 "format-buf", 1044 "format-buf",
1049 "fst",
1050 "indexmap", 1045 "indexmap",
1051 "insta", 1046 "insta",
1052 "itertools", 1047 "itertools",
@@ -1063,9 +1058,7 @@ dependencies = [
1063 "ra_syntax", 1058 "ra_syntax",
1064 "ra_text_edit", 1059 "ra_text_edit",
1065 "rand", 1060 "rand",
1066 "rayon",
1067 "rustc-hash", 1061 "rustc-hash",
1068 "superslice",
1069 "test_utils", 1062 "test_utils",
1070] 1063]
1071 1064
@@ -1073,18 +1066,9 @@ dependencies = [
1073name = "ra_ide_db" 1066name = "ra_ide_db"
1074version = "0.1.0" 1067version = "0.1.0"
1075dependencies = [ 1068dependencies = [
1076 "either",
1077 "format-buf",
1078 "fst", 1069 "fst",
1079 "indexmap",
1080 "insta",
1081 "itertools",
1082 "join_to_string",
1083 "log", 1070 "log",
1084 "once_cell",
1085 "ra_cfg",
1086 "ra_db", 1071 "ra_db",
1087 "ra_fmt",
1088 "ra_hir", 1072 "ra_hir",
1089 "ra_prof", 1073 "ra_prof",
1090 "ra_syntax", 1074 "ra_syntax",
@@ -1092,7 +1076,6 @@ dependencies = [
1092 "rayon", 1076 "rayon",
1093 "rustc-hash", 1077 "rustc-hash",
1094 "superslice", 1078 "superslice",
1095 "test_utils",
1096] 1079]
1097 1080
1098[[package]] 1081[[package]]
@@ -1120,7 +1103,6 @@ name = "ra_prof"
1120version = "0.1.0" 1103version = "0.1.0"
1121dependencies = [ 1104dependencies = [
1122 "backtrace", 1105 "backtrace",
1123 "itertools",
1124 "jemalloc-ctl", 1106 "jemalloc-ctl",
1125 "jemallocator", 1107 "jemallocator",
1126 "once_cell", 1108 "once_cell",
@@ -1163,7 +1145,6 @@ dependencies = [
1163name = "ra_text_edit" 1145name = "ra_text_edit"
1164version = "0.1.0" 1146version = "0.1.0"
1165dependencies = [ 1147dependencies = [
1166 "test_utils",
1167 "text_unit", 1148 "text_unit",
1168] 1149]
1169 1150
@@ -1322,7 +1303,6 @@ version = "0.1.0"
1322dependencies = [ 1303dependencies = [
1323 "anyhow", 1304 "anyhow",
1324 "crossbeam-channel", 1305 "crossbeam-channel",
1325 "either",
1326 "env_logger", 1306 "env_logger",
1327 "globset", 1307 "globset",
1328 "itertools", 1308 "itertools",
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"