Skip to content

Commit

Permalink
Add an HIR pretty-printer
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonas Schievink committed Aug 15, 2022
1 parent b6d59f2 commit dcbe892
Show file tree
Hide file tree
Showing 12 changed files with 914 additions and 203 deletions.
5 changes: 5 additions & 0 deletions crates/hir-def/src/body.rs
Expand Up @@ -4,6 +4,7 @@ mod lower;
#[cfg(test)]
mod tests;
pub mod scope;
mod pretty;

use std::{ops::Index, sync::Arc};

Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit dcbe892

Please sign in to comment.