From dc8df7ba219d9a403ee77027dd5a698f08a1dcce Mon Sep 17 00:00:00 2001 From: Blaž Hrastnik Date: Sun, 5 Dec 2021 14:52:56 +0900 Subject: Make thread_picker non-blocking --- helix-dap/src/client.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'helix-dap') diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs index 9598e24e..651bf4d6 100644 --- a/helix-dap/src/client.rs +++ b/helix-dap/src/client.rs @@ -209,7 +209,7 @@ impl Client { } /// Execute a RPC request on the debugger. - fn call( + pub fn call( &self, arguments: R::Arguments, ) -> impl Future> @@ -248,7 +248,7 @@ impl Client { } } - async fn request(&self, params: R::Arguments) -> Result + pub async fn request(&self, params: R::Arguments) -> Result where R::Arguments: serde::Serialize, R::Result: core::fmt::Debug, // TODO: temporary @@ -384,9 +384,8 @@ impl Client { Ok((response.stack_frames, response.total_frames)) } - pub async fn threads(&self) -> Result> { - let response = self.request::(()).await?; - Ok(response.threads) + pub fn threads(&self) -> impl Future> { + self.call::(()) } pub async fn scopes(&self, frame_id: usize) -> Result> { -- cgit v1.2.3-70-g09d2