aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model_api.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r--crates/ra_hir/src/code_model_api.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs
index d00d3246f..09b532f74 100644
--- a/crates/ra_hir/src/code_model_api.rs
+++ b/crates/ra_hir/src/code_model_api.rs
@@ -1,7 +1,8 @@
1use relative_path::RelativePathBuf;
1use ra_db::{CrateId, Cancelable, FileId}; 2use ra_db::{CrateId, Cancelable, FileId};
2use ra_syntax::{ast, SyntaxNode}; 3use ra_syntax::{ast, SyntaxNode};
3 4
4use crate::{Name, db::HirDatabase, DefId, Path, PerNs, module::{Problem, ModuleScope}}; 5use crate::{Name, db::HirDatabase, DefId, Path, PerNs, nameres::ModuleScope};
5 6
6/// hir::Crate describes a single crate. It's the main inteface with which 7/// hir::Crate describes a single crate. It's the main inteface with which
7/// crate's dependencies interact. Mostly, it should be just a proxy for the 8/// crate's dependencies interact. Mostly, it should be just a proxy for the
@@ -39,6 +40,17 @@ pub enum ModuleSource {
39 Module(ast::ModuleNode), 40 Module(ast::ModuleNode),
40} 41}
41 42
43#[derive(Clone, Debug, Hash, PartialEq, Eq)]
44pub enum Problem {
45 UnresolvedModule {
46 candidate: RelativePathBuf,
47 },
48 NotDirOwner {
49 move_to: RelativePathBuf,
50 candidate: RelativePathBuf,
51 },
52}
53
42impl Module { 54impl Module {
43 /// Name of this module. 55 /// Name of this module.
44 pub fn name(&self, db: &impl HirDatabase) -> Cancelable<Option<Name>> { 56 pub fn name(&self, db: &impl HirDatabase) -> Cancelable<Option<Name>> {