From 16c740526233b01980efdbb680b55718a71bb0e1 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 14 May 2019 01:42:59 +0300 Subject: expand to syntax node --- crates/ra_hir/src/nameres/raw.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/nameres') diff --git a/crates/ra_hir/src/nameres/raw.rs b/crates/ra_hir/src/nameres/raw.rs index 211e02068..bd32b264b 100644 --- a/crates/ra_hir/src/nameres/raw.rs +++ b/crates/ra_hir/src/nameres/raw.rs @@ -75,8 +75,11 @@ impl RawItems { source_ast_id_map: db.ast_id_map(file_id.into()), source_map: ImportSourceMap::default(), }; - let source_file = db.hir_parse(file_id); - collector.process_module(None, &*source_file); + if let Some(node) = db.parse_or_expand(file_id) { + if let Some(source_file) = ast::SourceFile::cast(&node) { + collector.process_module(None, &*source_file); + } + } (Arc::new(collector.raw_items), Arc::new(collector.source_map)) } -- cgit v1.2.3