diff options
author | Aleksey Kladov <[email protected]> | 2020-01-15 13:42:57 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-01-15 13:42:57 +0000 |
commit | 21ea62d2927ad88c56a4cb48bbd9932ba7bf5321 (patch) | |
tree | 909f5a76dd04943a6d3217232eec8262563e43ab /crates/ra_hir_def/src | |
parent | 4a9e4ec7e181c9cb17fe574073c2b718611ccec3 (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.rs | 7 |
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> { |