2021-05-21 23:59:52 +02:00
|
|
|
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
|
|
|
|
//
|
2022-08-01 13:47:09 +02:00
|
|
|
// | VS Code | **rust-analyzer: Debug ItemTree**
|
2021-05-21 23:59:52 +02:00
|
|
|
// |===
|
|
|
|
pub(crate) fn view_item_tree(db: &RootDatabase, file_id: FileId) -> String {
|
|
|
|
db.file_item_tree(file_id.into()).pretty_print()
|
|
|
|
}
|