aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir_def/src')
-rw-r--r--crates/ra_hir_def/src/nameres.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/crates/ra_hir_def/src/nameres.rs b/crates/ra_hir_def/src/nameres.rs
index 4d210eab1..e1a6a46df 100644
--- a/crates/ra_hir_def/src/nameres.rs
+++ b/crates/ra_hir_def/src/nameres.rs
@@ -145,6 +145,13 @@ impl ModuleOrigin {
145 } 145 }
146 } 146 }
147 147
148 pub fn is_inline(&self) -> bool {
149 match self {
150 ModuleOrigin::Inline { .. } => true,
151 ModuleOrigin::CrateRoot { .. } | ModuleOrigin::File { .. } => false,
152 }
153 }
154
148 /// Returns a node which defines this module. 155 /// Returns a node which defines this module.
149 /// That is, a file or a `mod foo {}` with items. 156 /// That is, a file or a `mod foo {}` with items.
150 fn definition_source(&self, db: &impl DefDatabase) -> InFile<ModuleSource> { 157 fn definition_source(&self, db: &impl DefDatabase) -> InFile<ModuleSource> {