flatten module structure
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
use relative_path::RelativePathBuf;
|
||||
use ra_db::{CrateId, Cancelable, FileId};
|
||||
use ra_syntax::{ast, SyntaxNode};
|
||||
|
||||
use crate::{Name, db::HirDatabase, DefId, Path, PerNs, module::{Problem, ModuleScope}};
|
||||
use crate::{Name, db::HirDatabase, DefId, Path, PerNs, nameres::ModuleScope};
|
||||
|
||||
/// hir::Crate describes a single crate. It's the main inteface with which
|
||||
/// crate's dependencies interact. Mostly, it should be just a proxy for the
|
||||
@@ -39,6 +40,17 @@ pub enum ModuleSource {
|
||||
Module(ast::ModuleNode),
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
|
||||
pub enum Problem {
|
||||
UnresolvedModule {
|
||||
candidate: RelativePathBuf,
|
||||
},
|
||||
NotDirOwner {
|
||||
move_to: RelativePathBuf,
|
||||
candidate: RelativePathBuf,
|
||||
},
|
||||
}
|
||||
|
||||
impl Module {
|
||||
/// Name of this module.
|
||||
pub fn name(&self, db: &impl HirDatabase) -> Cancelable<Option<Name>> {
|
||||
|
||||
Reference in New Issue
Block a user