]> git.lizzy.rs Git - rust.git/blob - src/tools/rust-analyzer/crates/ide/src/view_item_tree.rs
Auto merge of #98626 - oli-obk:tracing, r=lcnr
[rust.git] / src / tools / rust-analyzer / crates / ide / src / view_item_tree.rs
1 use hir::db::DefDatabase;
2 use ide_db::base_db::FileId;
3 use ide_db::RootDatabase;
4
5 // Feature: Debug ItemTree
6 //
7 // Displays the ItemTree of the currently open file, for debugging.
8 //
9 // |===
10 // | Editor  | Action Name
11 //
12 // | VS Code | **rust-analyzer: Debug ItemTree**
13 // |===
14 pub(crate) fn view_item_tree(db: &RootDatabase, file_id: FileId) -> String {
15     db.file_item_tree(file_id.into()).pretty_print()
16 }