This commit is contained in:
Dongdong Zhou 2022-08-24 21:15:17 +01:00 committed by GitHub
parent 2a4ed9e2ad
commit 55f17b10b5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 25 deletions

View File

@ -295,8 +295,6 @@ fn start(
}
fn start_remote(&self, remote: impl Remote) -> Result<()> {
remote.connection_debug();
use HostPlatform::*;
let (platform, architecture) = self.host_specification(&remote).unwrap();
@ -566,8 +564,6 @@ fn home_dir(&self) -> Result<String> {
fn upload_file(&self, local: impl AsRef<Path>, remote: &str) -> Result<()>;
fn command_builder(&self) -> Command;
fn connection_debug(&self);
}
struct SshRemote {
@ -594,10 +590,6 @@ impl SshRemote {
fn command_builder(user: &str, host: &str) -> Command {
let mut cmd = new_command("ssh");
cmd.arg(format!("{}@{}", user, host)).args(Self::SSH_ARGS);
#[cfg(debug_assertions)]
cmd.arg("-v");
cmd
}
}
@ -615,20 +607,6 @@ fn upload_file(&self, local: impl AsRef<Path>, remote: &str) -> Result<()> {
fn command_builder(&self) -> Command {
Self::command_builder(&self.user, &self.host)
}
fn connection_debug(&self) {
if let Ok(out) = self.command_builder().arg("-v").arg("exit").output() {
let stderr = String::from_utf8_lossy(&out.stderr);
for line in stderr.split_terminator(['\n', '\r']) {
if line.is_empty() {
continue;
}
log::debug!(target: "lapce_data::proxy::connection_debug", "{line}");
}
} else {
log::debug!(target: "lapce_data::proxy::connection_debug", "ssh debug output failed");
}
}
}
#[derive(Debug)]
@ -696,8 +674,6 @@ fn command_builder(&self) -> Command {
cmd.arg("-d").arg(&self.distro).arg("--");
cmd
}
fn connection_debug(&self) {}
}
// Rust-analyzer returns paths in the form of "file:///<drive>:/...", which gets parsed into URL

View File

@ -333,7 +333,10 @@ pub fn start_volt(
stderr.clone(),
)))
.preopened_dir(
wasmtime_wasi::Dir::from_std_file(std::fs::File::open(volt_path)?),
wasmtime_wasi::Dir::from_std_file(std::fs::File::open(
volt_path.join("volt.toml"),
)?)
.open_parent_dir(wasmtime_wasi::ambient_authority())?,
"/",
)?
.build();