diff options
-rw-r--r-- | Cargo.lock | 22 | ||||
-rw-r--r-- | crates/ra_batch/Cargo.toml | 20 | ||||
-rw-r--r-- | crates/ra_cli/Cargo.toml | 15 | ||||
-rw-r--r-- | crates/ra_cli/src/analysis_bench.rs | 4 | ||||
-rw-r--r-- | crates/ra_cli/src/analysis_stats.rs | 4 | ||||
-rw-r--r-- | crates/ra_cli/src/load_cargo.rs (renamed from crates/ra_batch/src/lib.rs) | 3 | ||||
-rw-r--r-- | crates/ra_cli/src/main.rs | 3 | ||||
-rw-r--r-- | xtask/tests/tidy-tests/docs.rs | 1 |
8 files changed, 23 insertions, 49 deletions
diff --git a/Cargo.lock b/Cargo.lock index 3a4929a0f..4ae611a6b 100644 --- a/Cargo.lock +++ b/Cargo.lock | |||
@@ -918,21 +918,6 @@ dependencies = [ | |||
918 | ] | 918 | ] |
919 | 919 | ||
920 | [[package]] | 920 | [[package]] |
921 | name = "ra_batch" | ||
922 | version = "0.1.0" | ||
923 | dependencies = [ | ||
924 | "crossbeam-channel", | ||
925 | "log", | ||
926 | "ra_db", | ||
927 | "ra_hir", | ||
928 | "ra_ide", | ||
929 | "ra_project_model", | ||
930 | "ra_vfs", | ||
931 | "ra_vfs_glob", | ||
932 | "rustc-hash", | ||
933 | ] | ||
934 | |||
935 | [[package]] | ||
936 | name = "ra_cargo_watch" | 921 | name = "ra_cargo_watch" |
937 | version = "0.1.0" | 922 | version = "0.1.0" |
938 | dependencies = [ | 923 | dependencies = [ |
@@ -960,18 +945,23 @@ dependencies = [ | |||
960 | name = "ra_cli" | 945 | name = "ra_cli" |
961 | version = "0.1.0" | 946 | version = "0.1.0" |
962 | dependencies = [ | 947 | dependencies = [ |
948 | "crossbeam-channel", | ||
963 | "env_logger", | 949 | "env_logger", |
964 | "itertools", | 950 | "itertools", |
951 | "log", | ||
965 | "pico-args", | 952 | "pico-args", |
966 | "ra_batch", | ||
967 | "ra_db", | 953 | "ra_db", |
968 | "ra_hir", | 954 | "ra_hir", |
969 | "ra_hir_def", | 955 | "ra_hir_def", |
970 | "ra_hir_ty", | 956 | "ra_hir_ty", |
971 | "ra_ide", | 957 | "ra_ide", |
972 | "ra_prof", | 958 | "ra_prof", |
959 | "ra_project_model", | ||
973 | "ra_syntax", | 960 | "ra_syntax", |
961 | "ra_vfs", | ||
962 | "ra_vfs_glob", | ||
974 | "rand", | 963 | "rand", |
964 | "rustc-hash", | ||
975 | ] | 965 | ] |
976 | 966 | ||
977 | [[package]] | 967 | [[package]] |
diff --git a/crates/ra_batch/Cargo.toml b/crates/ra_batch/Cargo.toml deleted file mode 100644 index 3bf351fe3..000000000 --- a/crates/ra_batch/Cargo.toml +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | [package] | ||
2 | edition = "2018" | ||
3 | name = "ra_batch" | ||
4 | version = "0.1.0" | ||
5 | authors = ["rust-analyzer developers"] | ||
6 | |||
7 | [lib] | ||
8 | doctest = false | ||
9 | |||
10 | [dependencies] | ||
11 | log = "0.4.5" | ||
12 | rustc-hash = "1.0" | ||
13 | crossbeam-channel = "0.4.0" | ||
14 | |||
15 | ra_vfs = "0.5.0" | ||
16 | ra_vfs_glob = { path = "../ra_vfs_glob" } | ||
17 | ra_db = { path = "../ra_db" } | ||
18 | ra_ide = { path = "../ra_ide" } | ||
19 | ra_hir = { path = "../ra_hir" } | ||
20 | ra_project_model = { path = "../ra_project_model" } | ||
diff --git a/crates/ra_cli/Cargo.toml b/crates/ra_cli/Cargo.toml index 53d4876f6..03494a809 100644 --- a/crates/ra_cli/Cargo.toml +++ b/crates/ra_cli/Cargo.toml | |||
@@ -6,18 +6,23 @@ authors = ["rust-analyzer developers"] | |||
6 | publish = false | 6 | publish = false |
7 | 7 | ||
8 | [dependencies] | 8 | [dependencies] |
9 | crossbeam-channel = "0.4.0" | ||
10 | env_logger = { version = "0.7.1", default-features = false } | ||
9 | itertools = "0.8.0" | 11 | itertools = "0.8.0" |
12 | log = "0.4.5" | ||
10 | pico-args = "0.3.0" | 13 | pico-args = "0.3.0" |
11 | env_logger = { version = "0.7.1", default-features = false } | ||
12 | rand = { version = "0.7.0", features = ["small_rng"] } | 14 | rand = { version = "0.7.0", features = ["small_rng"] } |
15 | rustc-hash = "1.0" | ||
13 | 16 | ||
14 | ra_syntax = { path = "../ra_syntax" } | ||
15 | ra_ide = { path = "../ra_ide" } | ||
16 | ra_batch = { path = "../ra_batch" } | ||
17 | hir = { path = "../ra_hir", package = "ra_hir" } | 17 | hir = { path = "../ra_hir", package = "ra_hir" } |
18 | hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" } | ||
19 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } | 18 | hir_def = { path = "../ra_hir_def", package = "ra_hir_def" } |
19 | hir_ty = { path = "../ra_hir_ty", package = "ra_hir_ty" } | ||
20 | ra_db = { path = "../ra_db" } | 20 | ra_db = { path = "../ra_db" } |
21 | ra_ide = { path = "../ra_ide" } | ||
22 | ra_project_model = { path = "../ra_project_model" } | ||
23 | ra_syntax = { path = "../ra_syntax" } | ||
24 | ra_vfs = "0.5.0" | ||
25 | ra_vfs_glob = { path = "../ra_vfs_glob" } | ||
21 | 26 | ||
22 | [dependencies.ra_prof] | 27 | [dependencies.ra_prof] |
23 | path = "../ra_prof" | 28 | path = "../ra_prof" |
diff --git a/crates/ra_cli/src/analysis_bench.rs b/crates/ra_cli/src/analysis_bench.rs index 4835a68ce..3f10ed400 100644 --- a/crates/ra_cli/src/analysis_bench.rs +++ b/crates/ra_cli/src/analysis_bench.rs | |||
@@ -13,7 +13,7 @@ use ra_db::{ | |||
13 | }; | 13 | }; |
14 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FilePosition, LineCol}; | 14 | use ra_ide::{Analysis, AnalysisChange, AnalysisHost, FilePosition, LineCol}; |
15 | 15 | ||
16 | use crate::Result; | 16 | use crate::{load_cargo::load_cargo, Result}; |
17 | 17 | ||
18 | pub(crate) struct Position { | 18 | pub(crate) struct Position { |
19 | path: PathBuf, | 19 | path: PathBuf, |
@@ -46,7 +46,7 @@ pub(crate) fn run(verbose: bool, path: &Path, op: Op) -> Result<()> { | |||
46 | 46 | ||
47 | let start = Instant::now(); | 47 | let start = Instant::now(); |
48 | eprint!("loading: "); | 48 | eprint!("loading: "); |
49 | let (mut host, roots) = ra_batch::load_cargo(path)?; | 49 | let (mut host, roots) = load_cargo(path)?; |
50 | let db = host.raw_database(); | 50 | let db = host.raw_database(); |
51 | eprintln!("{:?}\n", start.elapsed()); | 51 | eprintln!("{:?}\n", start.elapsed()); |
52 | 52 | ||
diff --git a/crates/ra_cli/src/analysis_stats.rs b/crates/ra_cli/src/analysis_stats.rs index bfa174d51..d40f04391 100644 --- a/crates/ra_cli/src/analysis_stats.rs +++ b/crates/ra_cli/src/analysis_stats.rs | |||
@@ -13,7 +13,7 @@ use ra_db::SourceDatabaseExt; | |||
13 | use ra_syntax::AstNode; | 13 | use ra_syntax::AstNode; |
14 | use rand::{seq::SliceRandom, thread_rng}; | 14 | use rand::{seq::SliceRandom, thread_rng}; |
15 | 15 | ||
16 | use crate::{progress_report::ProgressReport, Result, Verbosity}; | 16 | use crate::{load_cargo::load_cargo, progress_report::ProgressReport, Result, Verbosity}; |
17 | 17 | ||
18 | pub fn run( | 18 | pub fn run( |
19 | verbosity: Verbosity, | 19 | verbosity: Verbosity, |
@@ -24,7 +24,7 @@ pub fn run( | |||
24 | randomize: bool, | 24 | randomize: bool, |
25 | ) -> Result<()> { | 25 | ) -> Result<()> { |
26 | let db_load_time = Instant::now(); | 26 | let db_load_time = Instant::now(); |
27 | let (mut host, roots) = ra_batch::load_cargo(path)?; | 27 | let (mut host, roots) = load_cargo(path)?; |
28 | let db = host.raw_database(); | 28 | let db = host.raw_database(); |
29 | println!("Database loaded, {} roots, {:?}", roots.len(), db_load_time.elapsed()); | 29 | println!("Database loaded, {} roots, {:?}", roots.len(), db_load_time.elapsed()); |
30 | let analysis_time = Instant::now(); | 30 | let analysis_time = Instant::now(); |
diff --git a/crates/ra_batch/src/lib.rs b/crates/ra_cli/src/load_cargo.rs index 7744ba85a..2d6433f18 100644 --- a/crates/ra_batch/src/lib.rs +++ b/crates/ra_cli/src/load_cargo.rs | |||
@@ -139,7 +139,8 @@ pub fn load( | |||
139 | #[cfg(test)] | 139 | #[cfg(test)] |
140 | mod tests { | 140 | mod tests { |
141 | use super::*; | 141 | use super::*; |
142 | use ra_hir::Crate; | 142 | |
143 | use hir::Crate; | ||
143 | 144 | ||
144 | #[test] | 145 | #[test] |
145 | fn test_loading_rust_analyzer() { | 146 | fn test_loading_rust_analyzer() { |
diff --git a/crates/ra_cli/src/main.rs b/crates/ra_cli/src/main.rs index 9a7f9724e..4a428faff 100644 --- a/crates/ra_cli/src/main.rs +++ b/crates/ra_cli/src/main.rs | |||
@@ -1,5 +1,6 @@ | |||
1 | //! FIXME: write short doc here | 1 | //! FIXME: write short doc here |
2 | 2 | ||
3 | mod load_cargo; | ||
3 | mod analysis_stats; | 4 | mod analysis_stats; |
4 | mod analysis_bench; | 5 | mod analysis_bench; |
5 | mod progress_report; | 6 | mod progress_report; |
@@ -157,12 +158,10 @@ ARGS: | |||
157 | let path = { | 158 | let path = { |
158 | let mut trailing = matches.free()?; | 159 | let mut trailing = matches.free()?; |
159 | if trailing.len() != 1 { | 160 | if trailing.len() != 1 { |
160 | eprintln!("{}", help::ANALYSIS_STATS_HELP); | ||
161 | Err("Invalid flags")?; | 161 | Err("Invalid flags")?; |
162 | } | 162 | } |
163 | trailing.pop().unwrap() | 163 | trailing.pop().unwrap() |
164 | }; | 164 | }; |
165 | matches.finish().or_else(handle_extra_flags)?; | ||
166 | 165 | ||
167 | analysis_stats::run( | 166 | analysis_stats::run( |
168 | verbosity, | 167 | verbosity, |
diff --git a/xtask/tests/tidy-tests/docs.rs b/xtask/tests/tidy-tests/docs.rs index 7ae73b934..a8ed9793f 100644 --- a/xtask/tests/tidy-tests/docs.rs +++ b/xtask/tests/tidy-tests/docs.rs | |||
@@ -73,7 +73,6 @@ fn no_docs_comments() { | |||
73 | } | 73 | } |
74 | 74 | ||
75 | let whitelist = [ | 75 | let whitelist = [ |
76 | "ra_batch", | ||
77 | "ra_cli", | 76 | "ra_cli", |
78 | "ra_db", | 77 | "ra_db", |
79 | "ra_hir", | 78 | "ra_hir", |