diff --git a/src/process/mod.rs b/src/process/mod.rs index a130091..736be3c 100644 --- a/src/process/mod.rs +++ b/src/process/mod.rs @@ -168,12 +168,17 @@ impl TsserverProcess { .as_ref() .map(|handles| handles.response_rx.clone()) } + + pub fn pid(&self) -> Option { + self.child.as_ref().map(|handles| handles.child.id()) + } } impl Drop for TsserverProcess { fn drop(&mut self) { if let Some(mut handles) = self.child.take() { let _ = handles.child.kill(); + let _ = handles.child.wait(); } } }