WIP: ssh remoting: Add upload_binary field to SshConnections (#19748)

This removes the old `remote_server { "download_binary_on_host": bool }`
field and replaces it with a `upload_binary: bool` on every
`ssh_connection`.


@ConradIrwin it compiles, it connects, but I haven't tested it really
yet

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Thorsten Ball 2024-10-26 01:32:54 +02:00 committed by GitHub
parent 1acebb3c47
commit fc8a72cdd8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 204 additions and 235 deletions

View file

@ -25,7 +25,6 @@ use gpui::{
use http_client::{read_proxy_from_env, Uri};
use language::LanguageRegistry;
use log::LevelFilter;
use remote::SshConnectionOptions;
use reqwest_client::ReqwestClient;
use assets::Assets;
@ -616,26 +615,15 @@ fn handle_open_request(request: OpenRequest, app_state: Arc<AppState>, cx: &mut
return;
}
if let Some(connection_info) = request.ssh_connection {
if let Some(connection_options) = request.ssh_connection {
cx.spawn(|mut cx| async move {
let nickname = cx
.update(|cx| {
SshSettings::get_global(cx).nickname_for(
&connection_info.host,
connection_info.port,
&connection_info.username,
)
})
.ok()
.flatten();
let paths_with_position =
derive_paths_with_position(app_state.fs.as_ref(), request.open_paths).await;
open_ssh_project(
connection_info,
connection_options,
paths_with_position.into_iter().map(|p| p.path).collect(),
app_state,
workspace::OpenOptions::default(),
nickname,
&mut cx,
)
.await
@ -798,25 +786,10 @@ async fn restore_or_create_workspace(
task.await?;
}
SerializedWorkspaceLocation::Ssh(ssh) => {
let args = cx
.update(|cx| {
SshSettings::get_global(cx).args_for(&ssh.host, ssh.port, &ssh.user)
})
.ok()
.flatten();
let nickname = cx
.update(|cx| {
SshSettings::get_global(cx).nickname_for(&ssh.host, ssh.port, &ssh.user)
})
.ok()
.flatten();
let connection_options = SshConnectionOptions {
args,
host: ssh.host.clone(),
username: ssh.user.clone(),
port: ssh.port,
password: None,
};
let connection_options = cx.update(|cx| {
SshSettings::get_global(cx)
.connection_options_for(ssh.host, ssh.port, ssh.user)
})?;
let app_state = app_state.clone();
cx.spawn(move |mut cx| async move {
recent_projects::open_ssh_project(
@ -824,7 +797,6 @@ async fn restore_or_create_workspace(
ssh.paths.into_iter().map(PathBuf::from).collect(),
app_state,
workspace::OpenOptions::default(),
nickname,
&mut cx,
)
.await