rust-analyzer/crates/ide/src/view_item_tree.rs
Laurențiu Nicola 22c8c9c401 ⬆️ rust-analyzer
2022-08-09 07:23:57 +03:00

16 lines
410 B
Rust

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()
}