aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_def/src
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2020-01-15 13:42:57 +0000
committerAleksey Kladov <[email protected]>2020-01-15 13:42:57 +0000
commit21ea62d2927ad88c56a4cb48bbd9932ba7bf5321 (patch)
tree909f5a76dd04943a6d3217232eec8262563e43ab /crates/ra_hir_def/src
parent4a9e4ec7e181c9cb17fe574073c2b718611ccec3 (diff)
Don't parse child modules when doing diagnostics
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> {