shutdown lapce-proxy

This commit is contained in:
Dongdong Zhou 2022-08-17 19:22:47 +01:00
parent 48324342d1
commit 4cc59d1b42
2 changed files with 3 additions and 3 deletions

View File

@ -243,7 +243,6 @@ pub fn new(
disabled_volts, disabled_volts,
plugin_configurations, plugin_configurations,
); );
println!("proxy stopped");
let _ = event_sink.submit_command( let _ = event_sink.submit_command(
LAPCE_UI_COMMAND, LAPCE_UI_COMMAND,
LapceUICommand::ProxyUpdateStatus(ProxyStatus::Disconnected), LapceUICommand::ProxyUpdateStatus(ProxyStatus::Disconnected),
@ -401,8 +400,6 @@ fn start_remote(&self, remote: impl Remote) -> Result<()> {
.ok_or_else(|| anyhow!("can't find stdout"))?, .ok_or_else(|| anyhow!("can't find stdout"))?,
); );
println!("started remote proxy");
let (writer_tx, writer_rx) = crossbeam_channel::unbounded(); let (writer_tx, writer_rx) = crossbeam_channel::unbounded();
let (reader_tx, reader_rx) = crossbeam_channel::unbounded(); let (reader_tx, reader_rx) = crossbeam_channel::unbounded();
stdio_transport(stdin, writer_rx, stdout, reader_tx); stdio_transport(stdin, writer_rx, stdout, reader_tx);
@ -419,6 +416,8 @@ fn start_remote(&self, remote: impl Remote) -> Result<()> {
let _ = local_writer_tx.send(RpcMessage::Notification(rpc)); let _ = local_writer_tx.send(RpcMessage::Notification(rpc));
} }
ProxyRpc::Shutdown => { ProxyRpc::Shutdown => {
let _ = child.kill();
let _ = child.wait();
return; return;
} }
} }

View File

@ -105,6 +105,7 @@ fn handle_notification(&mut self, rpc: ProxyNotification) {
#[allow(deprecated)] #[allow(deprecated)]
let _ = sender.send(Msg::Shutdown); let _ = sender.send(Msg::Shutdown);
} }
self.proxy_rpc.shutdown();
} }
Update { path, delta, rev } => { Update { path, delta, rev } => {
let buffer = self.buffers.get_mut(&path).unwrap(); let buffer = self.buffers.get_mut(&path).unwrap();