Add initial support for WSL (#37035)
Closes #36188 ## Todo * [x] CLI * [x] terminals * [x] tasks ## For future PRs * debugging * UI for opening WSL projects * fixing workspace state restoration Release Notes: - Windows alpha: Zed now supports editing folders in WSL. --------- Co-authored-by: Junkui Zhang <364772080@qq.com>
This commit is contained in:
co-authored by
Junkui Zhang
parent
1c2e2a00fe
commit
f78f3e7729
@@ -258,8 +258,14 @@ impl DapStore {
|
||||
let connection;
|
||||
if let Some(c) = binary.connection {
|
||||
let host = Ipv4Addr::LOCALHOST;
|
||||
let port = dap::transport::TcpTransport::unused_port(host).await?;
|
||||
port_forwarding = Some((port, c.host.to_string(), c.port));
|
||||
let port;
|
||||
if remote.read_with(cx, |remote, _cx| remote.shares_network_interface())? {
|
||||
port = c.port;
|
||||
port_forwarding = None;
|
||||
} else {
|
||||
port = dap::transport::TcpTransport::unused_port(host).await?;
|
||||
port_forwarding = Some((port, c.host.to_string(), c.port));
|
||||
}
|
||||
connection = Some(TcpArguments {
|
||||
port,
|
||||
host,
|
||||
|
||||
@@ -87,7 +87,7 @@ use node_runtime::NodeRuntime;
|
||||
use parking_lot::Mutex;
|
||||
pub use prettier_store::PrettierStore;
|
||||
use project_settings::{ProjectSettings, SettingsObserver, SettingsObserverEvent};
|
||||
use remote::{RemoteClient, SshConnectionOptions};
|
||||
use remote::{RemoteClient, RemoteConnectionOptions};
|
||||
use rpc::{
|
||||
AnyProtoClient, ErrorCode,
|
||||
proto::{FromProto, LanguageServerPromptResponse, REMOTE_SERVER_PROJECT_ID, ToProto},
|
||||
@@ -1916,7 +1916,7 @@ impl Project {
|
||||
.map(|remote| remote.read(cx).connection_state())
|
||||
}
|
||||
|
||||
pub fn remote_connection_options(&self, cx: &App) -> Option<SshConnectionOptions> {
|
||||
pub fn remote_connection_options(&self, cx: &App) -> Option<RemoteConnectionOptions> {
|
||||
self.remote_client
|
||||
.as_ref()
|
||||
.map(|remote| remote.read(cx).connection_options())
|
||||
|
||||
@@ -512,7 +512,7 @@ fn create_remote_shell(
|
||||
*env = command.env;
|
||||
|
||||
log::debug!("Connecting to a remote server: {:?}", command.program);
|
||||
let host = remote_client.read(cx).connection_options().host;
|
||||
let host = remote_client.read(cx).connection_options().display_name();
|
||||
|
||||
Ok(Shell::WithArguments {
|
||||
program: command.program,
|
||||
|
||||
Reference in New Issue
Block a user