aboutsummaryrefslogtreecommitdiff
path: root/crates/rust-analyzer/src/handlers.rs
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2021-05-21 22:59:52 +0100
committerJonas Schievink <[email protected]>2021-05-21 22:59:52 +0100
commit271ec6b990523c79f93468a5b0ab5e1aceab50f6 (patch)
tree82e6df7e0d66797bae5ee26fa16af40f482ae365 /crates/rust-analyzer/src/handlers.rs
parent8d13864440ba8b6ede1097c79b28e4981caf714a (diff)
Add a "Debug ItemTree" LSP request
Diffstat (limited to 'crates/rust-analyzer/src/handlers.rs')
-rw-r--r--crates/rust-analyzer/src/handlers.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/crates/rust-analyzer/src/handlers.rs b/crates/rust-analyzer/src/handlers.rs
index 51041d7a0..aa12fd94b 100644
--- a/crates/rust-analyzer/src/handlers.rs
+++ b/crates/rust-analyzer/src/handlers.rs
@@ -117,6 +117,16 @@ pub(crate) fn handle_view_hir(
117 Ok(res) 117 Ok(res)
118} 118}
119 119
120pub(crate) fn handle_view_item_tree(
121 snap: GlobalStateSnapshot,
122 params: lsp_ext::ViewItemTreeParams,
123) -> Result<String> {
124 let _p = profile::span("handle_view_item_tree");
125 let file_id = from_proto::file_id(&snap, &params.text_document.uri)?;
126 let res = snap.analysis.view_item_tree(file_id)?;
127 Ok(res)
128}
129
120pub(crate) fn handle_view_crate_graph(snap: GlobalStateSnapshot, (): ()) -> Result<String> { 130pub(crate) fn handle_view_crate_graph(snap: GlobalStateSnapshot, (): ()) -> Result<String> {
121 let _p = profile::span("handle_view_crate_graph"); 131 let _p = profile::span("handle_view_crate_graph");
122 let dot = snap.analysis.view_crate_graph()??; 132 let dot = snap.analysis.view_crate_graph()??;