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

@@ -117,6 +117,16 @@ pub(crate) fn handle_view_hir(
Ok(res)
}
pub(crate) fn handle_view_item_tree(
snap: GlobalStateSnapshot,
params: lsp_ext::ViewItemTreeParams,
) -> Result<String> {
let _p = profile::span("handle_view_item_tree");
let file_id = from_proto::file_id(&snap, &params.text_document.uri)?;
let res = snap.analysis.view_item_tree(file_id)?;
Ok(res)
}
pub(crate) fn handle_view_crate_graph(snap: GlobalStateSnapshot, (): ()) -> Result<String> {
let _p = profile::span("handle_view_crate_graph");
let dot = snap.analysis.view_crate_graph()??;