Add settings to remote servers, use XDG paths on remote, and enable node LSPs (#19176)

Supersedes https://github.com/zed-industries/zed/pull/19166

TODO:
- [x] Update basic zed paths
- [x] update create_state_directory
- [x] Use this with `NodeRuntime`
- [x] Add server settings
- [x] Add an 'open server settings command'
- [x] Make sure it all works


Release Notes:

- Updated the actions `zed::OpenLocalSettings` and `zed::OpenLocalTasks`
to `zed::OpenProjectSettings` and `zed::OpenProjectTasks`.

---------

Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Richard <richard@zed.dev>
This commit is contained in:
Mikayla Maki 2024-10-15 23:32:44 -07:00 committed by GitHub
parent 1dda039f38
commit f944ebc4cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
44 changed files with 804 additions and 218 deletions

View file

@ -39,6 +39,7 @@ terminal_view.workspace = true
ui.workspace = true
util.workspace = true
workspace.workspace = true
paths.workspace = true
[dev-dependencies]
editor = { workspace = true, features = ["test-support"] }

View file

@ -948,7 +948,7 @@ impl DevServerProjects {
this.show_toast(
Toast::new(
NotificationId::identified::<
NotificationId::composite::<
SshServerAddressCopiedToClipboard,
>(
connection_string.clone()
@ -1002,7 +1002,7 @@ impl DevServerProjects {
);
this.show_toast(
Toast::new(
NotificationId::identified::<SshServerRemoval>(
NotificationId::composite::<SshServerRemoval>(
connection_string.clone(),
),
notification,

View file

@ -10,6 +10,7 @@ use gpui::{
Transformation, View,
};
use gpui::{AppContext, Model};
use release_channel::{AppVersion, ReleaseChannel};
use remote::{SshConnectionOptions, SshPlatform, SshRemoteClient};
use schemars::JsonSchema;
@ -377,9 +378,18 @@ impl remote::SshClientDelegate for SshClientDelegate {
rx
}
fn remote_server_binary_path(&self, cx: &mut AsyncAppContext) -> Result<PathBuf> {
fn remote_server_binary_path(
&self,
platform: SshPlatform,
cx: &mut AsyncAppContext,
) -> Result<PathBuf> {
let release_channel = cx.update(|cx| ReleaseChannel::global(cx))?;
Ok(format!(".local/zed-remote-server-{}", release_channel.dev_name()).into())
Ok(paths::remote_server_dir_relative().join(format!(
"zed-remote-server-{}-{}-{}",
release_channel.dev_name(),
platform.os,
platform.arch
)))
}
}
@ -487,7 +497,7 @@ impl SshClientDelegate {
let path = std::env::current_dir()?.join("target/remote_server/debug/remote_server.gz");
return Ok(Some((path, version)));
} else if let Some(triple) = platform.triple() {
smol::fs::create_dir_all("target/remote-server").await?;
smol::fs::create_dir_all("target/remote_server").await?;
self.update_status(Some("Installing cross.rs for cross-compilation"), cx);
log::info!("installing cross");