hir::Crate boilerplate
This commit is contained in:
15
crates/ra_hir/src/krate.rs
Normal file
15
crates/ra_hir/src/krate.rs
Normal file
@@ -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<CrateId> {
|
||||||
|
Vec::new()
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,12 +18,15 @@ pub mod db;
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod mock;
|
mod mock;
|
||||||
mod query_definitions;
|
mod query_definitions;
|
||||||
mod function;
|
|
||||||
mod module;
|
|
||||||
mod path;
|
mod path;
|
||||||
mod arena;
|
mod arena;
|
||||||
pub mod source_binder;
|
pub mod source_binder;
|
||||||
|
|
||||||
|
mod krate;
|
||||||
|
mod module;
|
||||||
|
mod function;
|
||||||
|
|
||||||
|
|
||||||
use std::ops::Index;
|
use std::ops::Index;
|
||||||
|
|
||||||
use ra_syntax::{SyntaxNodeRef, SyntaxNode};
|
use ra_syntax::{SyntaxNodeRef, SyntaxNode};
|
||||||
@@ -36,6 +39,7 @@ use crate::{
|
|||||||
|
|
||||||
pub use self::{
|
pub use self::{
|
||||||
path::{Path, PathKind},
|
path::{Path, PathKind},
|
||||||
|
krate::Crate,
|
||||||
module::{Module, ModuleId, Problem, nameres::ItemMap},
|
module::{Module, ModuleId, Problem, nameres::ItemMap},
|
||||||
function::{Function, FnScopes},
|
function::{Function, FnScopes},
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user