@@ -505,12 +505,7 @@ impl Client {
505 self.request_counter.fetch_add(1, Ordering::Relaxed)
505 self.request_counter.fetch_add(1, Ordering::Relaxed)
511− arguments: Option<Value>,
508+ async fn request(&self, command: String, arguments: Option<Value>) -> Result<Response> {
513− ) -> Result<Option<Response>> {
514 let (callback_rx, mut callback_tx) = channel(1);
509 let (callback_rx, mut callback_tx) = channel(1);
516 let req = Request {
511 let req = Request {
@@ -524,11 +519,7 @@ impl Client {
524 .send(req)
519 .send(req)
525 .expect("Failed to send request to debugger");
520 .expect("Failed to send request to debugger");
528− Ok(Some(callback_tx.recv().await.unwrap()?))
522+ Ok(callback_tx.recv().await.unwrap()?)
534 pub fn capabilities(&self) -> &DebuggerCapabilities {
525 pub fn capabilities(&self) -> &DebuggerCapabilities {
@@ -555,23 +546,22 @@ impl Client {
557 let response = self
548 let response = self
558− .request("initialize".to_owned(), to_value(args).ok(), true)
549+ .request("initialize".to_owned(), to_value(args).ok())
559− .await?
550+ .await?;
561 self.capabilities = from_value(response.body.unwrap()).ok();
551 self.capabilities = from_value(response.body.unwrap()).ok();
566 pub async fn disconnect(&mut self) -> Result<()> {
556 pub async fn disconnect(&mut self) -> Result<()> {
567− self.request("disconnect".to_owned(), None, true).await?;
557+ self.request("disconnect".to_owned(), None).await?;
571 pub async fn launch(&mut self, args: impl Serialize) -> Result<()> {
561 pub async fn launch(&mut self, args: impl Serialize) -> Result<()> {
572 let mut initialized = self.listen_for_event("initialized".to_owned()).await;
562 let mut initialized = self.listen_for_event("initialized".to_owned()).await;
574− let res = self.request("launch".to_owned(), to_value(args).ok(), true);
564+ let res = self.request("launch".to_owned(), to_value(args).ok());
575 let ev = initialized.recv();
565 let ev = initialized.recv();
576 join!(res, ev).0?;
566 join!(res, ev).0?;
@@ -581,7 +571,7 @@ impl Client {
581 pub async fn attach(&mut self, args: impl Serialize) -> Result<()> {
571 pub async fn attach(&mut self, args: impl Serialize) -> Result<()> {
582 let mut initialized = self.listen_for_event("initialized".to_owned()).await;
572 let mut initialized = self.listen_for_event("initialized".to_owned()).await;
584− let res = self.request("attach".to_owned(), to_value(args).ok(), false);
574+ let res = self.request("attach".to_owned(), to_value(args).ok());
585 let ev = initialized.recv();
575 let ev = initialized.recv();
586 join!(res, ev).0?;
576 join!(res, ev).0?;
@@ -609,17 +599,15 @@ impl Client {
611 let response = self
601 let response = self
612− .request("setBreakpoints".to_owned(), to_value(args).ok(), true)
602+ .request("setBreakpoints".to_owned(), to_value(args).ok())
613− .await?
603+ .await?;
615 let body: Option<SetBreakpointsResponseBody> = from_value(response.body.unwrap()).ok();
604 let body: Option<SetBreakpointsResponseBody> = from_value(response.body.unwrap()).ok();
617 Ok(body.map(|b| b.breakpoints).unwrap())
606 Ok(body.map(|b| b.breakpoints).unwrap())
620 pub async fn configuration_done(&mut self) -> Result<()> {
609 pub async fn configuration_done(&mut self) -> Result<()> {
621− self.request("configurationDone".to_owned(), None, true)
610+ self.request("configurationDone".to_owned(), None).await?;
@@ -627,9 +615,8 @@ impl Client {
627 let args = ContinueArguments { thread_id };
615 let args = ContinueArguments { thread_id };
629 let response = self
617 let response = self
630− .request("continue".to_owned(), to_value(args).ok(), true)
618+ .request("continue".to_owned(), to_value(args).ok())
631− .await?
619+ .await?;
634 let body: Option<ContinueResponseBody> = from_value(response.body.unwrap()).ok();
621 let body: Option<ContinueResponseBody> = from_value(response.body.unwrap()).ok();
@@ -648,9 +635,8 @@ impl Client {
650 let response = self
637 let response = self
651− .request("stackTrace".to_owned(), to_value(args).ok(), true)
638+ .request("stackTrace".to_owned(), to_value(args).ok())
652− .await?
639+ .await?;
655 let body: StackTraceResponseBody = from_value(response.body.unwrap()).unwrap();
641 let body: StackTraceResponseBody = from_value(response.body.unwrap()).unwrap();
@@ -658,10 +644,7 @@ impl Client {
660 pub async fn threads(&mut self) -> Result<Vec<Thread>> {
646 pub async fn threads(&mut self) -> Result<Vec<Thread>> {
662− .request("threads".to_owned(), None, true)
647+ let response = self.request("threads".to_owned(), None).await?;
666 let body: ThreadsResponseBody = from_value(response.body.unwrap()).unwrap();
649 let body: ThreadsResponseBody = from_value(response.body.unwrap()).unwrap();
@@ -672,9 +655,8 @@ impl Client {
672 let args = ScopesArguments { frame_id };
655 let args = ScopesArguments { frame_id };
674 let response = self
657 let response = self
675− .request("scopes".to_owned(), to_value(args).ok(), true)
658+ .request("scopes".to_owned(), to_value(args).ok())
676− .await?
659+ .await?;
679 let body: ScopesResponseBody = from_value(response.body.unwrap()).unwrap();
661 let body: ScopesResponseBody = from_value(response.body.unwrap()).unwrap();
@@ -691,9 +673,8 @@ impl Client {
693 let response = self
675 let response = self
694− .request("variables".to_owned(), to_value(args).ok(), true)
676+ .request("variables".to_owned(), to_value(args).ok())
695− .await?
677+ .await?;
698 let body: VariablesResponseBody = from_value(response.body.unwrap()).unwrap();
679 let body: VariablesResponseBody = from_value(response.body.unwrap()).unwrap();