Add a "Debug ItemTree" LSP request

This commit is contained in:
Jonas Schievink 2021-05-21 23:59:52 +02:00
parent 8d13864440
commit 271ec6b990
9 changed files with 108 additions and 0 deletions

View file

@ -50,6 +50,7 @@ mod typing;
mod markdown_remove;
mod doc_links;
mod view_crate_graph;
mod view_item_tree;
use std::sync::Arc;
@ -288,6 +289,10 @@ impl Analysis {
self.with_db(|db| view_hir::view_hir(&db, position))
}
pub fn view_item_tree(&self, file_id: FileId) -> Cancelable<String> {
self.with_db(|db| view_item_tree::view_item_tree(&db, file_id))
}
/// Renders the crate graph to GraphViz "dot" syntax.
pub fn view_crate_graph(&self) -> Cancelable<Result<String, String>> {
self.with_db(|db| view_crate_graph::view_crate_graph(&db))