cli: initial wsl control server

Adds an stdin/out json rpc server for wsl.

Exposes a singular install_local command to install+boot the vscode server on a port from a local archive.

Also refines the common rpc layer some more. I'm decently happy with it now.
This commit is contained in:
Connor Peet
2023-01-17 16:05:25 -08:00
parent ebc7a21d55
commit 2c2ead679b
21 changed files with 554 additions and 137 deletions

View File

@@ -135,6 +135,7 @@ impl Clone for Box<dyn LogSink> {
}
}
/// The basic log sink that writes output to stdout, with colors when relevant.
#[derive(Clone)]
pub struct StdioLogSink {
level: Level,
@@ -247,6 +248,17 @@ impl Logger {
}
}
/// Creates a new logger with the sink replace with the given sink.
pub fn with_sink<T>(&self, sink: T) -> Logger
where
T: LogSink + 'static,
{
Logger {
sink: vec![Box::new(sink)],
..self.clone()
}
}
pub fn get_download_logger<'a>(&'a self, prefix: &'static str) -> DownloadLogger<'a> {
DownloadLogger {
prefix,