Commit Graph
84 Commits
Author SHA1 Message Date
Antonio Scandurra f9723ae16b Undo temporary edits before performing rename or canceling it
Also, wire up remote renames.
2022-02-18 11:41:47 +01:00
Max Brunsfeld 54d7642712 Start work on renames 2022-02-17 18:01:07 -08:00
Antonio ScandurraandNathan Sobo ebecb6dad4 Use the lowest zstd compression level during tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-17 15:16:51 +01:00
Antonio Scandurra 303e8e1688 Wait for version before returning code actions 2022-02-17 14:46:26 +01:00
Max BrunsfeldandNathan Sobo 41ba980c9b Remove unnecessary waiting during completion RPC requests
Also, add completion requests to the randomized collaboration integration test,
to demonstrate that this is valid.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-16 17:23:16 -08:00
Max BrunsfeldandAntonio Scandurra 06fb9ccca0 Restore synchronization between responses and incoming messages
This removes the need to buffer pending messages in Client.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-16 10:28:32 -08:00
Max BrunsfeldandAntonio Scandurra cf4291a126 Distinguish between "foreground" and "background" RPC messages
Some types of messages, which entail state updates on the host, should be
processed in the order that they were sent. Other types of messages should
not block the processing of other messages.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-16 10:01:23 -08:00
20858699bc Add a Test message that we can use to assert on the behavior of Peer
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-02-16 18:32:03 +01:00
Antonio Scandurra c3ba8f59ed Ensure worktree updates are observed in order on the server 2022-02-16 14:05:10 +01:00
Antonio Scandurra 17b13b9362 Wait for request and response version before resolving completions 2022-02-15 10:17:35 +01:00
Max BrunsfeldandNathan Sobo d358072c74 Include the desired version in a SaveBuffer RPC request
When handling this messages on the host, wait until the desired
version has been observed before performing the save.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-14 17:51:26 -08:00
Max BrunsfeldandNathan Sobo 8d06049124 Ensure worktree updates are applied in order
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-14 16:19:29 -08:00
Max BrunsfeldandAntonio Scandurra fe46b89500 Remove logic for preserving RPC message order between peers
* On the server, spawn a separate task for each incoming message
* In the peer, eliminate the barrier that was used to enforce ordering
  of responses with respect to other incoming messages

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-14 10:51:12 -08:00
Antonio Scandurra fadb94afb2 Use selection instead of just the cursor when fetching code actions 2022-02-14 14:13:36 +01:00
Antonio Scandurra 1eea2f3653 Add integration test for code actions 2022-02-14 11:42:56 +01:00
Antonio Scandurra 5a7d391d73 Ensure response barrier is always dropped, even if request is canceled 2022-02-12 10:23:50 +01:00
Antonio Scandurra 4929b8c525 Move Buffer::format to Project::format 2022-02-11 12:07:46 +01:00
Antonio ScandurraandNathan Sobo 7d8641afb6 Make transactions serializable to enable edits on behalf of other users
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-08 19:48:21 +01:00
Antonio Scandurra 6768288da8 Bump protocol version 2022-02-08 15:00:06 +01:00
Antonio Scandurra 624eb5907e Serialize buffer in terms of operations rather than state
This is required because, after joining, we want to be able to refer
to operations that have happened prior to joining, which are not
captured by the state. There is probably a way of reconstructing operations
from the state, but that seems unnecessary and we've already talked about
wanting to have the server store operations rather than state once we start
persisting worktrees.
2022-02-08 14:59:46 +01:00
Antonio Scandurra dca974c7d4 Apply code actions remotely 2022-02-08 12:18:14 +01:00
Max BrunsfeldandNathan Sobo 8a2613d49c Preserve ordering between responses and other incoming messages
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-07 14:14:15 -08:00
d4fe1115e7 Use an unbounded channel for peer's outgoing messages
Using a bounded channel may have blocked the collaboration server
from making progress handling RPC traffic.

There's no need to apply backpressure to calling code within the
same process - suspending a task that is attempting to call `send` has
an even greater memory cost than just buffering a protobuf message.

We do still want a bounded channel for incoming messages, so that
we provide backpressure to noisy peers - blocking their writes as opposed
to allowing them to buffer arbitrarily many messages in our server.

Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-07 12:27:13 -08:00
Antonio Scandurra d765e75bad Apply additional edits for completion when the buffer is remote 2022-02-02 16:29:13 +01:00
Antonio Scandurra 91e5c2dfac Broadcast completion triggers to remote participants 2022-02-02 14:07:41 +01:00
Antonio Scandurra ed549e352f Start on requesting completions for remote buffers 2022-02-02 12:22:47 +01:00
Antonio ScandurraandNathan Sobo ff24766319 Fix warning
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-27 15:55:48 +01:00
Max BrunsfeldandNathan Sobo 0e55f0ccaa Use Rust 2021 edition in all crates
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 12:50:31 -08:00
Antonio ScandurraandNathan Sobo 02baaa3529 Bump the protocol version
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-26 17:42:04 +01:00
Max BrunsfeldandNathan Sobo 2b8685c1a2 Insert random delays when sending and receiving websocket messages in tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-24 16:37:22 -08:00
Antonio Scandurra 96b66dcce1 Fix race condition when opening a buffer and getting a definition to it 2022-01-24 18:47:55 +01:00
Antonio Scandurra 245490f934 Implement Project::definition when the buffer is remote 2022-01-24 13:10:13 +01:00
Antonio Scandurra f859d444ff Don't show conflict indicator on remote buffer after a reload 2022-01-24 10:17:36 +01:00
Antonio Scandurra 4372fe1ed0 Maintain remote buffers via UpdateBufferFile messages sent by host 2022-01-24 09:32:40 +01:00
Nathan Sobo da13d028a3 Send File protos as part of Buffer protos
Use the File proto to build the File associated with the buffer rather than relying on the local entry.
2022-01-22 22:19:04 -07:00
Nathan Sobo e2a2073bdb Remove worktree_path from File struct 2022-01-22 14:29:36 -07:00
Max Brunsfeld 34e42c0c5f Remove worktree_id from buffer-related RPC messages 2022-01-21 16:23:39 -08:00
Antonio Scandurra 6e7e86e491 Remove weak worktrees from project when nobody references them
Also, avoid showing them in the project panel as well as in the
contacts panel.
2022-01-21 14:34:14 +01:00
Antonio Scandurra 6b1f989c2b Omit worktree id when emitting Event::DiskBasedDiagnosticsUpdated
Sometimes we will have more than one worktree associated with the same
language server and in that case it's unclear which worktree id we should
report an event for.
2022-01-20 10:13:27 +01:00
30225678c0 Test ordering of responses with respect to uni-directional messages
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-12 11:19:17 -07:00
Antonio ScandurraandMax Brunsfeld 66694b4c9a Fix failing tests
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-12 18:43:23 +01:00
8b53868f8a Preserve the order of responses with respect to all other incoming messages
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-01-12 18:26:00 +01:00
Antonio ScandurraandNathan Sobo 9e4b118214 Use synchronous locks for Peer state
We hold these locks for a short amount of time anyway, and using an
async lock could cause parallel sends to happen in an order different
than the order in which `send`/`request` was called.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 18:02:41 +01:00
Antonio ScandurraandNathan Sobo 310def2923 Implement Buffer::format
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-12 18:01:20 +01:00
Antonio ScandurraandNathan Sobo cf62d26ed8 Display a "Checking..." message when running disk-based diagnostics
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-01-07 15:03:19 +01:00
Nathan SoboandMax Brunsfeld 2dbee1d914 Send diagnostic summaries to guests when they join the project
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-01-06 12:12:09 -07:00
Max Brunsfeld 8728d3292d Merge branch 'main' into polish-project-diagnostics
Also fix false failure in ModelHandle::condition when parking is not forbidden.
2022-01-05 10:53:18 -08:00
Antonio Scandurra e56609cf0c Ensure prior, deferred selections don't override newer selections 2022-01-05 15:43:26 +01:00
Antonio Scandurra 870fa5f278 Serialize deferred operations 2022-01-05 11:52:41 +01:00
Antonio Scandurra 7bc8eb4f3d Fix compile errors and get serialization unit test passing 2022-01-05 10:29:29 +01:00