diff --git a/cli/src/util.rs b/cli/src/util.rs index d7d8572e..f36cbe79 100644 --- a/cli/src/util.rs +++ b/cli/src/util.rs @@ -4,8 +4,23 @@ use std::process::{Child, ChildStdin, Command, Stdio}; use std::str; use tree_sitter::Parser; +#[cfg(windows)] +pub(crate) struct LogSession(); + +#[cfg(windows)] +pub(crate) fn start_logging_graphs(parser: &mut Parser, path: &str) -> Result { + Ok(LogSession()) +} + +#[cfg(windows)] +pub(crate) fn stop_logging_graphs(parser: &mut Parser, mut session: LogSession) -> Result<()> { + Ok(()) +} + +#[cfg(unix)] pub(crate) struct LogSession(Child, ChildStdin); +#[cfg(unix)] pub(crate) fn start_logging_graphs(parser: &mut Parser, path: &str) -> Result { let mut dot_file = File::create(path)?; dot_file.write(b"\n\n\n")?; @@ -19,13 +34,20 @@ pub(crate) fn start_logging_graphs(parser: &mut Parser, path: &str) -> Result Result<()> { drop(session.1); - parser.stop_printing_dot_graphs(); + + if cfg!(unix) { + parser.stop_printing_dot_graphs(); + } + session.0.wait()?; if cfg!(target_os = "macos") {