diff options
-rw-r--r-- | Cargo.lock | 20 | ||||
-rw-r--r-- | crates/ra_assists/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/ra_cargo_watch/Cargo.toml | 3 | ||||
-rw-r--r-- | crates/ra_hir/src/semantics.rs | 13 | ||||
-rw-r--r-- | crates/ra_hir_def/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/ra_ide/Cargo.toml | 3 | ||||
-rw-r--r-- | crates/ra_ide/src/extend_selection.rs | 8 | ||||
-rw-r--r-- | crates/ra_ide_db/Cargo.toml | 12 | ||||
-rw-r--r-- | crates/ra_prof/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/ra_text_edit/Cargo.toml | 4 | ||||
-rw-r--r-- | crates/rust-analyzer/Cargo.toml | 1 | ||||
-rw-r--r-- | crates/test_utils/Cargo.toml | 2 |
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" | |||
906 | name = "ra_assists" | 906 | name = "ra_assists" |
907 | version = "0.1.0" | 907 | version = "0.1.0" |
908 | dependencies = [ | 908 | dependencies = [ |
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" | |||
1046 | dependencies = [ | 1042 | dependencies = [ |
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 = [ | |||
1073 | name = "ra_ide_db" | 1066 | name = "ra_ide_db" |
1074 | version = "0.1.0" | 1067 | version = "0.1.0" |
1075 | dependencies = [ | 1068 | dependencies = [ |
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" | |||
1120 | version = "0.1.0" | 1103 | version = "0.1.0" |
1121 | dependencies = [ | 1104 | dependencies = [ |
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 = [ | |||
1163 | name = "ra_text_edit" | 1145 | name = "ra_text_edit" |
1164 | version = "0.1.0" | 1146 | version = "0.1.0" |
1165 | dependencies = [ | 1147 | dependencies = [ |
1166 | "test_utils", | ||
1167 | "text_unit", | 1148 | "text_unit", |
1168 | ] | 1149 | ] |
1169 | 1150 | ||
@@ -1322,7 +1303,6 @@ version = "0.1.0" | |||
1322 | dependencies = [ | 1303 | dependencies = [ |
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 | |||
11 | format-buf = "1.0.0" | 11 | format-buf = "1.0.0" |
12 | join_to_string = "0.1.3" | 12 | join_to_string = "0.1.3" |
13 | rustc-hash = "1.1.0" | 13 | rustc-hash = "1.1.0" |
14 | either = "1.5.3" | ||
15 | 14 | ||
16 | ra_syntax = { path = "../ra_syntax" } | 15 | ra_syntax = { path = "../ra_syntax" } |
17 | ra_text_edit = { path = "../ra_text_edit" } | 16 | ra_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" | |||
9 | lsp-types = { version = "0.71.0", features = ["proposed"] } | 9 | lsp-types = { version = "0.71.0", features = ["proposed"] } |
10 | log = "0.4.8" | 10 | log = "0.4.8" |
11 | cargo_metadata = "0.9.1" | 11 | cargo_metadata = "0.9.1" |
12 | jod-thread = "0.1.0" | ||
13 | parking_lot = "0.10.0" | ||
14 | serde_json = "1.0.48" | 12 | serde_json = "1.0.48" |
15 | 13 | ||
16 | [dev-dependencies] | 14 | [dev-dependencies] |
17 | insta = "0.13.1" | 15 | insta = "0.13.1" |
18 | serde_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" | |||
14 | either = "1.5.3" | 14 | either = "1.5.3" |
15 | anymap = "0.12.1" | 15 | anymap = "0.12.1" |
16 | drop_bomb = "0.1.4" | 16 | drop_bomb = "0.1.4" |
17 | itertools = "0.8.2" | ||
18 | 17 | ||
19 | ra_arena = { path = "../ra_arena" } | 18 | ra_arena = { path = "../ra_arena" } |
20 | ra_db = { path = "../ra_db" } | 19 | ra_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" | |||
17 | itertools = "0.8.2" | 17 | itertools = "0.8.2" |
18 | join_to_string = "0.1.3" | 18 | join_to_string = "0.1.3" |
19 | log = "0.4.8" | 19 | log = "0.4.8" |
20 | rayon = "1.3.0" | ||
21 | fst = { version = "0.3.5", default-features = false } | ||
22 | rustc-hash = "1.1.0" | 20 | rustc-hash = "1.1.0" |
23 | superslice = "1.0.0" | ||
24 | rand = { version = "0.7.3", features = ["small_rng"] } | 21 | rand = { version = "0.7.3", features = ["small_rng"] } |
25 | once_cell = "1.3.1" | 22 | once_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 | ||
172 | fn 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. |
179 | fn shallowest_node(node: &SyntaxNode) -> SyntaxNode { | 173 | fn 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 | |||
11 | wasm = [] | 11 | wasm = [] |
12 | 12 | ||
13 | [dependencies] | 13 | [dependencies] |
14 | either = "1.5.3" | ||
15 | format-buf = "1.0.0" | ||
16 | indexmap = "1.3.2" | ||
17 | itertools = "0.8.2" | ||
18 | join_to_string = "0.1.3" | ||
19 | log = "0.4.8" | 14 | log = "0.4.8" |
20 | rayon = "1.3.0" | 15 | rayon = "1.3.0" |
21 | fst = { version = "0.3.5", default-features = false } | 16 | fst = { version = "0.3.5", default-features = false } |
22 | rustc-hash = "1.1.0" | 17 | rustc-hash = "1.1.0" |
23 | superslice = "1.0.0" | 18 | superslice = "1.0.0" |
24 | once_cell = "1.3.1" | ||
25 | 19 | ||
26 | ra_syntax = { path = "../ra_syntax" } | 20 | ra_syntax = { path = "../ra_syntax" } |
27 | ra_text_edit = { path = "../ra_text_edit" } | 21 | ra_text_edit = { path = "../ra_text_edit" } |
28 | ra_db = { path = "../ra_db" } | 22 | ra_db = { path = "../ra_db" } |
29 | ra_cfg = { path = "../ra_cfg" } | ||
30 | ra_fmt = { path = "../ra_fmt" } | ||
31 | ra_prof = { path = "../ra_prof" } | 23 | ra_prof = { path = "../ra_prof" } |
32 | test_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`. |
36 | hir = { path = "../ra_hir", package = "ra_hir" } | 27 | hir = { path = "../ra_hir", package = "ra_hir" } |
37 | |||
38 | [dev-dependencies] | ||
39 | insta = "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] |
12 | once_cell = "1.3.1" | 12 | once_cell = "1.3.1" |
13 | itertools = "0.8.2" | ||
14 | backtrace = { version = "0.3.44", optional = true } | 13 | backtrace = { 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 | |||
9 | doctest = false | 9 | doctest = false |
10 | 10 | ||
11 | [dependencies] | 11 | [dependencies] |
12 | text_unit = "0.1.9" | 12 | text_unit = "0.1.10" |
13 | 13 | ||
14 | [dev-dependencies] | ||
15 | test_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] |
16 | anyhow = "1.0.26" | 16 | anyhow = "1.0.26" |
17 | crossbeam-channel = "0.4.0" | 17 | crossbeam-channel = "0.4.0" |
18 | either = "1.5.3" | ||
19 | env_logger = { version = "0.7.1", default-features = false } | 18 | env_logger = { version = "0.7.1", default-features = false } |
20 | globset = "0.4.4" | 19 | globset = "0.4.4" |
21 | itertools = "0.8.2" | 20 | itertools = "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] |
11 | difference = "2.0.0" | 11 | difference = "2.0.0" |
12 | text_unit = "0.1.9" | 12 | text_unit = "0.1.10" |
13 | serde_json = "1.0.48" | 13 | serde_json = "1.0.48" |