aboutsummaryrefslogtreecommitdiff
path: root/crates/ide/src/view_item_tree.rs
blob: 3dc03085d651c9f0f2727341f29c8ade90274430 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use hir::db::DefDatabase;
use ide_db::base_db::FileId;
use ide_db::RootDatabase;

// Feature: Debug ItemTree
//
// Displays the ItemTree of the currently open file, for debugging.
//
// |===
// | Editor  | Action Name
//
// | VS Code | **Rust Analyzer: Debug ItemTree**
// |===
pub(crate) fn view_item_tree(db: &RootDatabase, file_id: FileId) -> String {
    db.file_item_tree(file_id.into()).pretty_print()
}