diff options
author | Aleksey Kladov <[email protected]> | 2019-05-12 21:03:37 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-05-12 21:03:37 +0100 |
commit | 9cba67b2ad0ef43b5c405f21f516c9ebee63a932 (patch) | |
tree | 8e6cd37bc459cdb9444d482f74aa2455d06499b1 /crates/ra_hir/src/source_binder.rs | |
parent | 98531dc785535ccde9edc798a17275b9a2f5c1fb (diff) |
simplify
Diffstat (limited to 'crates/ra_hir/src/source_binder.rs')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index bb485e35f..179faebfb 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -283,21 +283,9 @@ impl SourceAnalyzer { | |||
283 | self.infer.as_ref()?.field_resolution(expr_id) | 283 | self.infer.as_ref()?.field_resolution(expr_id) |
284 | } | 284 | } |
285 | 285 | ||
286 | pub fn resolve_macro_call( | 286 | pub fn resolve_macro_call(&self, macro_call: &ast::MacroCall) -> Option<MacroByExampleDef> { |
287 | &self, | 287 | let id = self.resolver.resolve_macro_call(macro_call.path().and_then(Path::from_ast))?; |
288 | db: &impl HirDatabase, | 288 | Some(MacroByExampleDef { id }) |
289 | file_id: FileId, | ||
290 | macro_call: &ast::MacroCall, | ||
291 | ) -> Option<MacroByExampleDef> { | ||
292 | let hir_id = file_id.into(); | ||
293 | let ast_id = db.ast_id_map(hir_id).ast_id(macro_call).with_file_id(hir_id); | ||
294 | let call_id = self.resolver.resolve_macro_call( | ||
295 | db, | ||
296 | macro_call.path().and_then(Path::from_ast), | ||
297 | ast_id, | ||
298 | )?; | ||
299 | let loc = call_id.loc(db); | ||
300 | Some(MacroByExampleDef { id: loc.def }) | ||
301 | } | 289 | } |
302 | 290 | ||
303 | pub fn resolve_hir_path( | 291 | pub fn resolve_hir_path( |