summaryrefslogtreecommitdiffstats
path: root/src/tools/rust-analyzer/crates/ide/src/view_item_tree.rs
blob: 9c1f93356ee2d0637733ae7f035f230313b0fa76 (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()
}