diff options
Diffstat (limited to 'crates/ra_db/src/input.rs')
-rw-r--r-- | crates/ra_db/src/input.rs | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 7c3dd9296..023183e29 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -1,9 +1,9 @@ | |||
1 | /// This modules specifies the input to rust-analyzer. In some sense, this is | 1 | /// This module specifies the input to rust-analyzer. In some sense, this is |
2 | /// **the** most important module, because all other fancy stuff is strictly | 2 | /// **the** most important module, because all other fancy stuff is strictly |
3 | /// derived from this input. | 3 | /// derived from this input. |
4 | /// | 4 | /// |
5 | /// Note that neither this module, nor any other part of the analyzer's core do | 5 | /// Note that neither this module, nor any other part of the analyzer's core do |
6 | /// actual IO. See `vfs` and `project_model` in `ra_lsp_server` crate for how | 6 | /// actual IO. See `vfs` and `project_model` in the `ra_lsp_server` crate for how |
7 | /// actual IO is done and lowered to input. | 7 | /// actual IO is done and lowered to input. |
8 | use std::sync::Arc; | 8 | use std::sync::Arc; |
9 | 9 | ||
@@ -17,17 +17,17 @@ use rustc_hash::FxHashSet; | |||
17 | /// `FileId` is an integer which uniquely identifies a file. File paths are | 17 | /// `FileId` is an integer which uniquely identifies a file. File paths are |
18 | /// messy and system-dependent, so most of the code should work directly with | 18 | /// messy and system-dependent, so most of the code should work directly with |
19 | /// `FileId`, without inspecting the path. The mapping between `FileId` and path | 19 | /// `FileId`, without inspecting the path. The mapping between `FileId` and path |
20 | /// and `SourceRoot` is constant. File rename is represented as a pair of | 20 | /// and `SourceRoot` is constant. A file rename is represented as a pair of |
21 | /// deletion/creation. | 21 | /// deletion/creation. |
22 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] | 22 | #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] |
23 | pub struct FileId(pub u32); | 23 | pub struct FileId(pub u32); |
24 | 24 | ||
25 | /// Files are grouped into source roots. A source root is a directory on the | 25 | /// Files are grouped into source roots. A source root is a directory on the |
26 | /// file systems which is watched for changes. Typically it corresponds to a | 26 | /// file systems which is watched for changes. Typically it corresponds to a |
27 | /// Cargo package. Source roots *might* be nested: in this case, file belongs to | 27 | /// Rust crate. Source roots *might* be nested: in this case, a file belongs to |
28 | /// the nearest enclosing source root. Path to files are always relative to a | 28 | /// the nearest enclosing source root. Paths to files are always relative to a |
29 | /// source root, and analyzer does not know the root path of the source root at | 29 | /// source root, and the analyzer does not know the root path of the source root at |
30 | /// all. So, a file from one source root can't refere a file in another source | 30 | /// all. So, a file from one source root can't refer to a file in another source |
31 | /// root by path. | 31 | /// root by path. |
32 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] | 32 | #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)] |
33 | pub struct SourceRootId(pub u32); | 33 | pub struct SourceRootId(pub u32); |
@@ -38,15 +38,15 @@ pub struct SourceRoot { | |||
38 | } | 38 | } |
39 | 39 | ||
40 | /// `CrateGraph` is a bit of information which turns a set of text files into a | 40 | /// `CrateGraph` is a bit of information which turns a set of text files into a |
41 | /// number of Rust crates. Each Crate is the `FileId` of it's root module, the | 41 | /// number of Rust crates. Each crate is defined by the `FileId` of its root module, |
42 | /// set of cfg flags (not yet implemented) and the set of dependencies. Note | 42 | /// the set of cfg flags (not yet implemented) and the set of dependencies. Note |
43 | /// that, due to cfg's, there might be several crates for a single `FileId`! As | 43 | /// that, due to cfg's, there might be several crates for a single `FileId`! As |
44 | /// in the rust-lang proper, a crate does not have a name. Instead, names are | 44 | /// in the rust-lang proper, a crate does not have a name. Instead, names are |
45 | /// specified on dependency edges. That is, a crate might be known under | 45 | /// specified on dependency edges. That is, a crate might be known under |
46 | /// different names in different dependant crates. | 46 | /// different names in different dependent crates. |
47 | /// | 47 | /// |
48 | /// Note that `CrateGraph` is build-system agnostic: it's a concept of the Rust | 48 | /// Note that `CrateGraph` is build-system agnostic: it's a concept of the Rust |
49 | /// langauge proper, not a concept of the build system. In practice, we get | 49 | /// language proper, not a concept of the build system. In practice, we get |
50 | /// `CrateGraph` by lowering `cargo metadata` output. | 50 | /// `CrateGraph` by lowering `cargo metadata` output. |
51 | #[derive(Debug, Clone, Default, PartialEq, Eq)] | 51 | #[derive(Debug, Clone, Default, PartialEq, Eq)] |
52 | pub struct CrateGraph { | 52 | pub struct CrateGraph { |