on master help sign in
Add attach command
commit541f7a051466cd8313b2aad77392c9799c81018b authorDmitry Sharshakov <d3dx12.xx@gmail.com> dateFri 13 Aug 2021, 20:40 (5 years ago) parentaac586b
1 file changed+21
helix-dap/src/client.rs+21
helix-dap/src/client.rs+21
@@ -393,6 +393,27 @@ impl Client {
393393 }
394394 }
395395
396+ pub async fn attach(&mut self, args: impl Serialize) -> Result<()> {
397+ self.request("attach".to_owned(), to_value(args).ok())
398+ .await?;
399+
400+ match self
401+ .server_rx
402+ .recv()
403+ .await
404+ .expect("Expected initialized event")
405+ {
406+ Payload::Event(Event { event, .. }) => {
407+ if event == *"initialized" {
408+ Ok(())
409+ } else {
410+ unreachable!()
411+ }
412+ }
413+ _ => unreachable!(),
414+ }
415+ }
416+
396417 pub async fn set_breakpoints(
397418 &mut self,
398419 file: String,