diff options
author | Aleksey Kladov <[email protected]> | 2018-12-08 20:40:55 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-12-09 10:33:16 +0000 |
commit | 9c6c7ec2daacdbcaae8fe697b30d4c99aae69090 (patch) | |
tree | 847ca25c17684aad76aa82629a796c57f513f28a /crates/ra_hir/src | |
parent | 9b1356464a834e0b9a88dd3eeabc50bf1d734f35 (diff) |
hir::Crate boilerplate
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/krate.rs | 15 | ||||
-rw-r--r-- | crates/ra_hir/src/lib.rs | 8 |
2 files changed, 21 insertions, 2 deletions
diff --git a/crates/ra_hir/src/krate.rs b/crates/ra_hir/src/krate.rs new file mode 100644 index 000000000..367ddbd21 --- /dev/null +++ b/crates/ra_hir/src/krate.rs | |||
@@ -0,0 +1,15 @@ | |||
1 | use crate::FileId; | ||
2 | |||
3 | #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] | ||
4 | pub struct CrateId(u32); | ||
5 | |||
6 | #[derive(Debug)] | ||
7 | pub struct Crate { | ||
8 | root: FileId, | ||
9 | } | ||
10 | |||
11 | impl Crate { | ||
12 | pub fn dependencies(&self) -> Vec<CrateId> { | ||
13 | Vec::new() | ||
14 | } | ||
15 | } | ||
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs index f50b922af..0fa2ec50f 100644 --- a/crates/ra_hir/src/lib.rs +++ b/crates/ra_hir/src/lib.rs | |||
@@ -18,12 +18,15 @@ pub mod db; | |||
18 | #[cfg(test)] | 18 | #[cfg(test)] |
19 | mod mock; | 19 | mod mock; |
20 | mod query_definitions; | 20 | mod query_definitions; |
21 | mod function; | ||
22 | mod module; | ||
23 | mod path; | 21 | mod path; |
24 | mod arena; | 22 | mod arena; |
25 | pub mod source_binder; | 23 | pub mod source_binder; |
26 | 24 | ||
25 | mod krate; | ||
26 | mod module; | ||
27 | mod function; | ||
28 | |||
29 | |||
27 | use std::ops::Index; | 30 | use std::ops::Index; |
28 | 31 | ||
29 | use ra_syntax::{SyntaxNodeRef, SyntaxNode}; | 32 | use ra_syntax::{SyntaxNodeRef, SyntaxNode}; |
@@ -36,6 +39,7 @@ use crate::{ | |||
36 | 39 | ||
37 | pub use self::{ | 40 | pub use self::{ |
38 | path::{Path, PathKind}, | 41 | path::{Path, PathKind}, |
42 | krate::Crate, | ||
39 | module::{Module, ModuleId, Problem, nameres::ItemMap}, | 43 | module::{Module, ModuleId, Problem, nameres::ItemMap}, |
40 | function::{Function, FnScopes}, | 44 | function::{Function, FnScopes}, |
41 | }; | 45 | }; |