Commit Graph
67 Commits
Author SHA1 Message Date
Max Brunsfeld 917543cc32 Handle Peer responses using a futures::oneshot instead of postage::mpsc 2022-03-01 13:37:33 -08:00
Antonio Scandurra 466db69780 Pass a reference to TestAppContext in tests
This allows us to drop the context *after* we ran all futures to
completion and that's crucial otherwise we'll never drop entities
and/or flush effects.
2022-03-01 12:01:02 +01:00
Antonio ScandurraandNathan Sobo 2111ec04c8 Make SearchProject a Foreground message
However, the randomized integration test is still failing:

```
ITERATIONS=100000 SEED=3027 OPERATIONS=200 cargo test --release test_random --package=zed-server -- --nocapture
```

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-28 16:19:34 +01:00
Max Brunsfeld 1278f5484f Add project search RPC messages 2022-02-25 12:38:31 -08:00
Max Brunsfeld e714b00c26 Improve logging around handling RPC requests on client 2022-02-23 15:37:51 -08:00
17c9aa1819 Remove ShareWorktree message
Instead, create an empty worktree on guests when a worktree is first *registered*, then update it via an initial UpdateWorktree message.

This prevents the host from referencing a worktree in definition RPC responses that hasn't yet been observed by the guest. We could have waited until the entire worktree was shared, but this could take a long time, so instead we create an empty one on guests and proceed from there.

We still have randomized test failures as of this commit:

SEED=9519 MAX_PEERS=2 ITERATIONS=10000 OPERATIONS=7 ct -p zed-server test_random_collaboration

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-23 11:56:09 -07:00
Antonio Scandurra d1b4384f80 WIP 2022-02-23 19:04:22 +01:00
Antonio Scandurra f3c6320eeb Move document highlights RPC message to the background 2022-02-23 16:16:02 +01:00
Nathan Sobo 73fcebb8b2 Bump protocol version 2022-02-23 06:33:31 -07:00
Max Brunsfeld e140f70e3c Show document highlights from the language server when moving the cursor 2022-02-22 17:16:31 -08:00
Max BrunsfeldandNathan Sobo 25d45378e4 Implement find-all-references
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-22 14:27:16 -08:00
Antonio Scandurra f0195ac3a3 Allow opening of buffers associated with a project symbol 2022-02-22 16:26:01 +01:00
Antonio Scandurra 2a6d486d14 Retrieve project symbols over RPC 2022-02-22 14:50:06 +01:00
Antonio Scandurra ab73343323 WIP: Start on getting project symbols over RPC 2022-02-22 12:15:38 +01:00
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
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
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 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 Scandurra 6768288da8 Bump protocol version 2022-02-08 15:00:06 +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 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
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
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
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 7bc8eb4f3d Fix compile errors and get serialization unit test passing 2022-01-05 10:29:29 +01:00
Max Brunsfeld 984e366c32 WIP - Serialize buffer in terms of its state, not its base text + ops
The main reason for this is that we need to include information about
a buffer's UndoMap into its protobuf representation. But it's a bit
complex to correctly incorporate this information into the current
protobuf representation.

If we want to continue reusing `Buffer::apply_remote_edit` for
incorporating the historical operations, we need to either make
that method capable of incorporating already-undone edits, or
serialize the UndoMap into undo *operations*, so that we can apply
these undo operations after the fact when deserializing. But this is
not trivial, because an UndoOperation requires information about
the full offset ranges that were undone.
2022-01-04 18:06:16 -08:00
Max BrunsfeldandAntonio Scandurra d8b888c9cb Replicate diagnostic summaries
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-01-04 14:29:22 -08:00