aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-08 20:40:55 +0000
committerAleksey Kladov <[email protected]>2018-12-09 10:33:16 +0000
commit9c6c7ec2daacdbcaae8fe697b30d4c99aae69090 (patch)
tree847ca25c17684aad76aa82629a796c57f513f28a /crates/ra_hir/src
parent9b1356464a834e0b9a88dd3eeabc50bf1d734f35 (diff)
hir::Crate boilerplate
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/krate.rs15
-rw-r--r--crates/ra_hir/src/lib.rs8
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 @@
1use crate::FileId;
2
3#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
4pub struct CrateId(u32);
5
6#[derive(Debug)]
7pub struct Crate {
8 root: FileId,
9}
10
11impl 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)]
19mod mock; 19mod mock;
20mod query_definitions; 20mod query_definitions;
21mod function;
22mod module;
23mod path; 21mod path;
24mod arena; 22mod arena;
25pub mod source_binder; 23pub mod source_binder;
26 24
25mod krate;
26mod module;
27mod function;
28
29
27use std::ops::Index; 30use std::ops::Index;
28 31
29use ra_syntax::{SyntaxNodeRef, SyntaxNode}; 32use ra_syntax::{SyntaxNodeRef, SyntaxNode};
@@ -36,6 +39,7 @@ use crate::{
36 39
37pub use self::{ 40pub 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};