mirror of https://github.com/lapce/lapce.git
Volt fix
This commit is contained in:
parent
2a4ed9e2ad
commit
55f17b10b5
|
@ -295,8 +295,6 @@ fn start(
|
||||||
}
|
}
|
||||||
|
|
||||||
fn start_remote(&self, remote: impl Remote) -> Result<()> {
|
fn start_remote(&self, remote: impl Remote) -> Result<()> {
|
||||||
remote.connection_debug();
|
|
||||||
|
|
||||||
use HostPlatform::*;
|
use HostPlatform::*;
|
||||||
let (platform, architecture) = self.host_specification(&remote).unwrap();
|
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 upload_file(&self, local: impl AsRef<Path>, remote: &str) -> Result<()>;
|
||||||
|
|
||||||
fn command_builder(&self) -> Command;
|
fn command_builder(&self) -> Command;
|
||||||
|
|
||||||
fn connection_debug(&self);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct SshRemote {
|
struct SshRemote {
|
||||||
|
@ -594,10 +590,6 @@ impl SshRemote {
|
||||||
fn command_builder(user: &str, host: &str) -> Command {
|
fn command_builder(user: &str, host: &str) -> Command {
|
||||||
let mut cmd = new_command("ssh");
|
let mut cmd = new_command("ssh");
|
||||||
cmd.arg(format!("{}@{}", user, host)).args(Self::SSH_ARGS);
|
cmd.arg(format!("{}@{}", user, host)).args(Self::SSH_ARGS);
|
||||||
|
|
||||||
#[cfg(debug_assertions)]
|
|
||||||
cmd.arg("-v");
|
|
||||||
|
|
||||||
cmd
|
cmd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -615,20 +607,6 @@ fn upload_file(&self, local: impl AsRef<Path>, remote: &str) -> Result<()> {
|
||||||
fn command_builder(&self) -> Command {
|
fn command_builder(&self) -> Command {
|
||||||
Self::command_builder(&self.user, &self.host)
|
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)]
|
#[derive(Debug)]
|
||||||
|
@ -696,8 +674,6 @@ fn command_builder(&self) -> Command {
|
||||||
cmd.arg("-d").arg(&self.distro).arg("--");
|
cmd.arg("-d").arg(&self.distro).arg("--");
|
||||||
cmd
|
cmd
|
||||||
}
|
}
|
||||||
|
|
||||||
fn connection_debug(&self) {}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rust-analyzer returns paths in the form of "file:///<drive>:/...", which gets parsed into URL
|
// Rust-analyzer returns paths in the form of "file:///<drive>:/...", which gets parsed into URL
|
||||||
|
|
|
@ -333,7 +333,10 @@ pub fn start_volt(
|
||||||
stderr.clone(),
|
stderr.clone(),
|
||||||
)))
|
)))
|
||||||
.preopened_dir(
|
.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();
|
.build();
|
||||||
|
|
Loading…
Reference in New Issue