@@ -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,