rust/crates/ide/src/view_item_tree.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
410 B
Rust
Raw Normal View History

2021-05-21 16:59:52 -05: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
//
// | 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()
}