diff options
Diffstat (limited to 'crates/ra_project_model/src/json_project.rs')
-rw-r--r-- | crates/ra_project_model/src/json_project.rs | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/crates/ra_project_model/src/json_project.rs b/crates/ra_project_model/src/json_project.rs deleted file mode 100644 index b030c8a6a..000000000 --- a/crates/ra_project_model/src/json_project.rs +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | //! FIXME: write short doc here | ||
2 | |||
3 | use std::path::PathBuf; | ||
4 | |||
5 | use rustc_hash::{FxHashMap, FxHashSet}; | ||
6 | use serde::Deserialize; | ||
7 | |||
8 | /// A root points to the directory which contains Rust crates. rust-analyzer watches all files in | ||
9 | /// all roots. Roots might be nested. | ||
10 | #[derive(Clone, Debug, Deserialize)] | ||
11 | #[serde(transparent)] | ||
12 | pub struct Root { | ||
13 | pub(crate) path: PathBuf, | ||
14 | } | ||
15 | |||
16 | /// A crate points to the root module of a crate and lists the dependencies of the crate. This is | ||
17 | /// useful in creating the crate graph. | ||
18 | #[derive(Clone, Debug, Deserialize)] | ||
19 | pub struct Crate { | ||
20 | pub(crate) root_module: PathBuf, | ||
21 | pub(crate) edition: Edition, | ||
22 | pub(crate) deps: Vec<Dep>, | ||
23 | pub(crate) atom_cfgs: FxHashSet<String>, | ||
24 | pub(crate) key_value_cfgs: FxHashMap<String, String>, | ||
25 | pub(crate) out_dir: Option<PathBuf>, | ||
26 | pub(crate) proc_macro_dylib_path: Option<PathBuf>, | ||
27 | } | ||
28 | |||
29 | #[derive(Clone, Copy, Debug, Deserialize)] | ||
30 | #[serde(rename = "edition")] | ||
31 | pub enum Edition { | ||
32 | #[serde(rename = "2015")] | ||
33 | Edition2015, | ||
34 | #[serde(rename = "2018")] | ||
35 | Edition2018, | ||
36 | } | ||
37 | |||
38 | /// Identifies a crate by position in the crates array. | ||
39 | #[derive(Clone, Copy, Debug, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd)] | ||
40 | #[serde(transparent)] | ||
41 | pub struct CrateId(pub usize); | ||
42 | |||
43 | /// A dependency of a crate, identified by its id in the crates array and name. | ||
44 | #[derive(Clone, Debug, Deserialize)] | ||
45 | pub struct Dep { | ||
46 | #[serde(rename = "crate")] | ||
47 | pub(crate) krate: CrateId, | ||
48 | pub(crate) name: String, | ||
49 | } | ||
50 | |||
51 | /// Roots and crates that compose this Rust project. | ||
52 | #[derive(Clone, Debug, Deserialize)] | ||
53 | pub struct JsonProject { | ||
54 | pub(crate) roots: Vec<Root>, | ||
55 | pub(crate) crates: Vec<Crate>, | ||
56 | } | ||