Add attach command
This commit is contained in:
parent
aac586b546
commit
541f7a0514
1 changed files with 21 additions and 0 deletions
|
@ -393,6 +393,27 @@ impl Client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn attach(&mut self, args: impl Serialize) -> Result<()> {
|
||||||
|
self.request("attach".to_owned(), to_value(args).ok())
|
||||||
|
.await?;
|
||||||
|
|
||||||
|
match self
|
||||||
|
.server_rx
|
||||||
|
.recv()
|
||||||
|
.await
|
||||||
|
.expect("Expected initialized event")
|
||||||
|
{
|
||||||
|
Payload::Event(Event { event, .. }) => {
|
||||||
|
if event == *"initialized" {
|
||||||
|
Ok(())
|
||||||
|
} else {
|
||||||
|
unreachable!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => unreachable!(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn set_breakpoints(
|
pub async fn set_breakpoints(
|
||||||
&mut self,
|
&mut self,
|
||||||
file: String,
|
file: String,
|
||||||
|
|
Loading…
Add table
Reference in a new issue