From 21ea62d2927ad88c56a4cb48bbd9932ba7bf5321 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 15 Jan 2020 14:42:57 +0100 Subject: Don't parse child modules when doing diagnostics --- crates/ra_hir_def/src/nameres.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'crates/ra_hir_def') 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 { } } + pub fn is_inline(&self) -> bool { + match self { + ModuleOrigin::Inline { .. } => true, + ModuleOrigin::CrateRoot { .. } | ModuleOrigin::File { .. } => false, + } + } + /// Returns a node which defines this module. /// That is, a file or a `mod foo {}` with items. fn definition_source(&self, db: &impl DefDatabase) -> InFile { -- cgit v1.2.3