diff options
author | Aleksey Kladov <[email protected]> | 2019-05-13 23:42:59 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-05-14 07:03:43 +0100 |
commit | 16c740526233b01980efdbb680b55718a71bb0e1 (patch) | |
tree | f68886b41ccc4134ad0dc038ed88005be50eee8d /crates/ra_hir/src/nameres | |
parent | 101b3abfd70cc988b24f30a610d46a3986df54d3 (diff) |
expand to syntax node
Diffstat (limited to 'crates/ra_hir/src/nameres')
-rw-r--r-- | crates/ra_hir/src/nameres/raw.rs | 7 |
1 files changed, 5 insertions, 2 deletions
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 { | |||
75 | source_ast_id_map: db.ast_id_map(file_id.into()), | 75 | source_ast_id_map: db.ast_id_map(file_id.into()), |
76 | source_map: ImportSourceMap::default(), | 76 | source_map: ImportSourceMap::default(), |
77 | }; | 77 | }; |
78 | let source_file = db.hir_parse(file_id); | 78 | if let Some(node) = db.parse_or_expand(file_id) { |
79 | collector.process_module(None, &*source_file); | 79 | if let Some(source_file) = ast::SourceFile::cast(&node) { |
80 | collector.process_module(None, &*source_file); | ||
81 | } | ||
82 | } | ||
80 | (Arc::new(collector.raw_items), Arc::new(collector.source_map)) | 83 | (Arc::new(collector.raw_items), Arc::new(collector.source_map)) |
81 | } | 84 | } |
82 | 85 | ||