From 9c6c7ec2daacdbcaae8fe697b30d4c99aae69090 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 8 Dec 2018 23:40:55 +0300 Subject: hir::Crate boilerplate --- crates/ra_hir/src/krate.rs | 15 +++++++++++++++ crates/ra_hir/src/lib.rs | 8 ++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 crates/ra_hir/src/krate.rs (limited to 'crates/ra_hir/src') 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 @@ +use crate::FileId; + +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] +pub struct CrateId(u32); + +#[derive(Debug)] +pub struct Crate { + root: FileId, +} + +impl Crate { + pub fn dependencies(&self) -> Vec { + Vec::new() + } +} 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; #[cfg(test)] mod mock; mod query_definitions; -mod function; -mod module; mod path; mod arena; pub mod source_binder; +mod krate; +mod module; +mod function; + + use std::ops::Index; use ra_syntax::{SyntaxNodeRef, SyntaxNode}; @@ -36,6 +39,7 @@ use crate::{ pub use self::{ path::{Path, PathKind}, + krate::Crate, module::{Module, ModuleId, Problem, nameres::ItemMap}, function::{Function, FnScopes}, }; -- cgit v1.2.3