From abf2179c0b606730acadc61451739baecfa33a5d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 14 Oct 2019 16:20:55 +0300 Subject: Prepare SourceDatabase API for lazy file loading --- crates/ra_hir/src/ids.rs | 35 +---------------------------------- 1 file changed, 1 insertion(+), 34 deletions(-) (limited to 'crates/ra_hir/src/ids.rs') diff --git a/crates/ra_hir/src/ids.rs b/crates/ra_hir/src/ids.rs index 85b022744..499dcafea 100644 --- a/crates/ra_hir/src/ids.rs +++ b/crates/ra_hir/src/ids.rs @@ -85,11 +85,7 @@ impl HirFileId { // Note: // The final goal we would like to make all parse_macro success, // such that the following log will not call anyway. - log::warn!( - "fail on macro_parse: (reason: {}) {}", - err, - macro_call_id.debug_dump(db) - ); + log::warn!("fail on macro_parse: (reason: {})", err,); }) .ok()?; match macro_file.macro_file_kind { @@ -367,35 +363,6 @@ impl AstItemDef for TypeAliasId { } } -impl MacroCallId { - pub fn debug_dump(self, db: &impl AstDatabase) -> String { - let loc = self.loc(db); - let node = loc.ast_id.to_node(db); - let syntax_str = { - let mut res = String::new(); - node.syntax().text().for_each_chunk(|chunk| { - if !res.is_empty() { - res.push(' ') - } - res.push_str(chunk) - }); - res - }; - - // dump the file name - let file_id: HirFileId = self.loc(db).ast_id.file_id(); - let original = file_id.original_file(db); - let macro_rules = db.macro_def(loc.def); - - format!( - "macro call [file: {:?}] : {}\nhas rules: {}", - db.file_relative_path(original), - syntax_str, - macro_rules.is_some() - ) - } -} - /// This exists just for Chalk, because Chalk just has a single `StructId` where /// we have different kinds of ADTs, primitive types and special type /// constructors like tuples and function pointers. -- cgit v1.2.3