diff options
author | Jonas Schievink <[email protected]> | 2021-05-21 22:59:52 +0100 |
---|---|---|
committer | Jonas Schievink <[email protected]> | 2021-05-21 22:59:52 +0100 |
commit | 271ec6b990523c79f93468a5b0ab5e1aceab50f6 (patch) | |
tree | 82e6df7e0d66797bae5ee26fa16af40f482ae365 /crates/rust-analyzer/src/handlers.rs | |
parent | 8d13864440ba8b6ede1097c79b28e4981caf714a (diff) |
Add a "Debug ItemTree" LSP request
Diffstat (limited to 'crates/rust-analyzer/src/handlers.rs')
-rw-r--r-- | crates/rust-analyzer/src/handlers.rs | 10 |
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 | ||
120 | pub(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, ¶ms.text_document.uri)?; | ||
126 | let res = snap.analysis.view_item_tree(file_id)?; | ||
127 | Ok(res) | ||
128 | } | ||
129 | |||
120 | pub(crate) fn handle_view_crate_graph(snap: GlobalStateSnapshot, (): ()) -> Result<String> { | 130 | pub(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()??; |