Skip to content

Commit

Permalink
Merge branch 'main' into ssh-reconnect-reliability
Browse files Browse the repository at this point in the history
  • Loading branch information
mikayla-maki authored Oct 18, 2024
2 parents 1ba60d1 + 3e0c5c1 commit 809b8bd
Show file tree
Hide file tree
Showing 14 changed files with 185 additions and 428 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async fn test_sharing_an_ssh_remote_project(
.await;

// Set up project on remote FS
let (forwarder, server_ssh) = SshRemoteClient::fake_server(server_cx);
let (client_ssh, server_ssh) = SshRemoteClient::fake(cx_a, server_cx);
let remote_fs = FakeFs::new(server_cx.executor());
remote_fs
.insert_tree(
Expand Down Expand Up @@ -67,7 +67,6 @@ async fn test_sharing_an_ssh_remote_project(
)
});

let client_ssh = SshRemoteClient::fake_client(forwarder, cx_a).await;
let (project_a, worktree_id) = client_a
.build_ssh_project("/code/project1", client_ssh, cx_a)
.await;
Expand Down
10 changes: 10 additions & 0 deletions crates/project/src/lsp_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6057,6 +6057,16 @@ impl LspStore {
);
})?;
}
"textDocument/rename" => {
this.update(&mut cx, |this, _| {
if let Some(server) = this.language_server_for_id(server_id)
{
server.update_capabilities(|capabilities| {
capabilities.rename_provider = None
})
}
})?;
}
"textDocument/rangeFormatting" => {
this.update(&mut cx, |this, _| {
if let Some(server) = this.language_server_for_id(server_id)
Expand Down
4 changes: 0 additions & 4 deletions crates/project/src/project.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1243,10 +1243,6 @@ impl Project {
self.client.clone()
}

pub fn ssh_client(&self) -> Option<Model<SshRemoteClient>> {
self.ssh_client.clone()
}

pub fn user_store(&self) -> Model<UserStore> {
self.user_store.clone()
}
Expand Down
8 changes: 1 addition & 7 deletions crates/proto/proto/zed.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ message Envelope {
uint32 id = 1;
optional uint32 responding_to = 2;
optional PeerId original_sender_id = 3;
optional uint32 ack_id = 266;

oneof payload {
Hello hello = 4;
Expand Down Expand Up @@ -296,9 +295,7 @@ message Envelope {
OpenServerSettings open_server_settings = 263;

GetPermalinkToLine get_permalink_to_line = 264;
GetPermalinkToLineResponse get_permalink_to_line_response = 265;

FlushBufferedMessages flush_buffered_messages = 267;
GetPermalinkToLineResponse get_permalink_to_line_response = 265; // current max
}

reserved 87 to 88;
Expand Down Expand Up @@ -2524,6 +2521,3 @@ message GetPermalinkToLine {
message GetPermalinkToLineResponse {
string permalink = 1;
}

message FlushBufferedMessages {}
message FlushBufferedMessagesResponse {}
1 change: 0 additions & 1 deletion crates/proto/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ macro_rules! messages {
responding_to,
original_sender_id,
payload: Some(envelope::Payload::$name(self)),
ack_id: None,
}
}

Expand Down
2 changes: 0 additions & 2 deletions crates/proto/src/proto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,6 @@ messages!(
(OpenServerSettings, Foreground),
(GetPermalinkToLine, Foreground),
(GetPermalinkToLineResponse, Foreground),
(FlushBufferedMessages, Foreground),
);

request_messages!(
Expand Down Expand Up @@ -499,7 +498,6 @@ request_messages!(
(RemoveWorktree, Ack),
(OpenServerSettings, OpenBufferResponse),
(GetPermalinkToLine, GetPermalinkToLineResponse),
(FlushBufferedMessages, Ack),
);

entity_messages!(
Expand Down
1 change: 0 additions & 1 deletion crates/remote/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test-support = ["fs/test-support"]

[dependencies]
anyhow.workspace = true
async-trait.workspace = true
collections.workspace = true
fs.workspace = true
futures.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions crates/remote/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ use anyhow::Result;
use futures::{AsyncRead, AsyncReadExt, AsyncWrite, AsyncWriteExt};
use prost::Message as _;
use rpc::proto::Envelope;
use std::mem::size_of;

#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub struct MessageId(pub u32);
Expand Down Expand Up @@ -30,8 +29,10 @@ pub async fn read_message<S: AsyncRead + Unpin>(
) -> Result<Envelope> {
buffer.resize(MESSAGE_LEN_SIZE, 0);
stream.read_exact(buffer).await?;

let len = message_len_from_buffer(buffer);
read_message_with_len(stream, buffer, len).await
let result = read_message_with_len(stream, buffer, len).await;
result
}

pub async fn write_message<S: AsyncWrite + Unpin>(
Expand Down
Loading

0 comments on commit 809b8bd

Please sign in to comment.