Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/body.rs')
-rw-r--r--crates/hir-def/src/body.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/crates/hir-def/src/body.rs b/crates/hir-def/src/body.rs
index 080a307b1f..1d818d9626 100644
--- a/crates/hir-def/src/body.rs
+++ b/crates/hir-def/src/body.rs
@@ -4,6 +4,7 @@ mod lower;
#[cfg(test)]
mod tests;
pub mod scope;
+mod pretty;
use std::{ops::Index, sync::Arc};
@@ -352,6 +353,10 @@ impl Body {
}
}
+ pub fn pretty_print(&self, db: &dyn DefDatabase, owner: DefWithBodyId) -> String {
+ pretty::print_body_hir(db, self, owner)
+ }
+
fn new(
db: &dyn DefDatabase,
expander: Expander,