Commit Graph
5814 Commits
Author SHA1 Message Date
Max Brunsfeld 5ca603dbeb Don't process gitignore updates after the initial scan 2023-04-12 18:17:29 -07:00
Max Brunsfeld 3d14bfd90c Prioritize path refresh requests over gitignore status updates 2023-04-12 18:08:00 -07:00
Max Brunsfeld 2d97387f49 Restructure background scanner to handle refresh requests even while scanning 2023-04-12 16:29:51 -07:00
Antonio Scandurra 6d8635fa29 Merge pull request #2349 from zed-industries/randomized-tests-operation-script
Restructure randomized integration test to allow editing and replaying a plan, fix discovered bugs
2023-04-12 11:45:47 +02:00
Antonio Scandurra 12a286ac50 Forget buffered operations when resyncing with the host
Previously, we could end up with a situation where the host did not
see an operation but a guest that didn't have that buffer open would. When
such guest would finally open the buffer, they would apply the operation
without however sending it to the host. The guest wouldn't bother resyncing
it because it wasn't part of its open buffers.
2023-04-12 10:39:01 +02:00
Max Brunsfeld 61d048cb25 Don't wait for host's reply before broadcasting buffer updates to guests 2023-04-11 12:37:08 -07:00
Max BrunsfeldandAntonio Scandurra 727afae4ff Fix unit tests after fixing gpui model drop semantics
co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-11 10:58:01 -07:00
Antonio Scandurra 42b10044fc Fix running client crate tests 2023-04-11 17:43:05 +02:00
Antonio Scandurra 5eb1719ab8 Re-send worktree if reconnecting while initial scan isn't finished yet
Previously, if the client was disconnected while the initial worktree
state was being sent, it would not see the remaining state after reconnecting.
This was due to `scan_id` and `completed_scan_id` both being initialized to
`0`, so the client would ask for updates since `0` and get nothing.

This commit changes the worktree to initialize `scan_id` to `1` and
`completed_scan_id` to `0`, so that we get the full worktree again on reconnect.
2023-04-11 17:15:43 +02:00
Antonio Scandurra 172441ab72 Cancel pending calls when participant fails to reconnect
Previously, we would only cancel pending calls when the room became
empty.
2023-04-11 16:33:08 +02:00
Antonio Scandurra 5e37c893c2 Ensure project is still alive by the time remote LSP request starts 2023-04-11 15:14:32 +02:00
Antonio Scandurra 5898600239 Use LspCommand to handle code actions 2023-04-11 15:12:58 +02:00
Antonio Scandurra 651a83977e 🔥 2023-04-11 14:53:08 +02:00
Antonio Scandurra ac532cb6fa Use LspCommand to handle completions 2023-04-11 14:52:07 +02:00
Antonio Scandurra 9e6d865882 Prevent already dropped model from being upgraded during release 2023-04-11 10:43:05 +02:00
Antonio Scandurra 6ba5e06247 Stop waiting for buffers when releasing a remote project 2023-04-11 10:42:43 +02:00
Antonio Scandurra 643381ce0c Make UpdateDiffBase a Foreground message to prevent reordering 2023-04-11 08:50:26 +02:00
Max Brunsfeld abfbba68f0 Improve randomized test assertion message when diff base is wrong 2023-04-10 18:28:34 -07:00
Max Brunsfeld 25e3c4e586 Fix leak when project is unshared while LSP handler waits for edits 2023-04-10 17:03:58 -07:00
JuliaandJoseph Lyons 189784f5fd In the case of Github release deserialize error, log response text
Co-Authored-By: Joseph Lyons <joseph@zed.dev>
2023-04-10 16:45:15 -04:00
Max BrunsfeldandAntonio Scandurra e79815622c Preserve ordering between UpdateProject and CreateBufferForPeer messages
Previously, because UpdateProject messages were sent in a separately-
spawned task, they could be sent after CreateBufferForPeer messages that
were intended to be sent after them.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-10 12:54:25 -07:00
Antonio Scandurra 9761febf82 Avoid broadcasting SaveBuffer in response to a client's save request
The host will send a `SaveBuffer` message anyway and this prevents re-querying
the database, which could cause two `BufferSaved` messages to race and, as a
result, cause guest to apply them in the wrong order.
2023-04-10 10:02:13 +02:00
Antonio Scandurra 3a82c04248 Improve assertion message when buffer state diverges 2023-04-10 10:01:44 +02:00
Antonio Scandurra 016343e65d Merge branch 'main' into randomized-tests-operation-script 2023-04-10 08:45:22 +02:00
Antonio Scandurra 7f73ebdab5 Apply BufferReloaded message to incomplete remote buffers 2023-04-10 08:41:31 +02:00
Antonio Scandurra 372e31d54f Don't panic if worktree was dropped before sending path changes
In `refresh_entry`, we send a message to the `self.path_changes_tx` channel
to notify the background thread that a path has changed. However, given that
`refresh_entry` uses `spawn_weak`, the worktree could get dropped before sending
the message, which could cause a panic.

This commit changes the code to return an error instead of panicking.
2023-04-10 08:16:08 +02:00
Max BrunsfeldandAntonio Scandurra acbf9b55d7 Halt UpdateBuffer messages until sync if one errors
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-07 17:31:52 -07:00
Max Brunsfeld e50c48852a Wait for host to acknowledge buffer updates before sending them to other guests 2023-04-07 16:27:48 -07:00
Max BrunsfeldandAntonio Scandurra f519f32ec2 Fixed removal of closed projects in randomized test
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-07 12:24:59 -07:00
Joseph Lyons 035189a2a1 Put file location details of panic on separate line 2023-04-07 14:32:14 -04:00
Nathan Sobo 2615a11f7c Don't export platform::* from gpui
I'd like to avoid cluttering the top-level namespace with all the platform-
specific types.
2023-04-07 11:45:53 -06:00
Joseph T. Lyons f450692e77 Merge pull request #2364 from zed-industries/put-backtrace-on-a-newline-when-reporting-panics
Put backtrace on a new line when reporting panics
2023-04-07 12:46:53 -04:00
Joseph Lyons 9cf3481fc7 Put backtrace on a new line when reporting panics 2023-04-07 12:12:18 -04:00
Joseph T. Lyons c58601ab8d Merge pull request #2363 from zed-industries/add-copy-path-commands
Update copy path commands
2023-04-07 12:09:39 -04:00
Joseph Lyons 5e55eb279c Update copy path commands 2023-04-07 02:36:56 -04:00
Nathan Sobo 95eb918b4c Fix broken test due to trimmed trailing whitespace during formatting 2023-04-06 16:10:39 -06:00
Nathan Sobo 8136d8a8a6 Fix formatting 2023-04-06 15:54:44 -06:00
Nathan Sobo de9bf6dfbd Merge MutableAppContext into AppContext
There may have been a good reason for the difference at some point, or I was
still learning Rust. But now it's just &mut AppContext vs &AppContext.
2023-04-06 15:49:03 -06:00
Max BrunsfeldandAntonio Scandurra aa7918c4b5 Fix handling of redundant buffer creation messages on guests
Check if the buffer already exists *before* overwriting it.
Ignore redundant registrations on remote projects.

Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-06 12:17:25 -07:00
Max BrunsfeldandAntonio Scandurra 22a6a243bc Move project assertions into main assertion function
Co-authored-by: Antonio Scandurra <antonio@zed.dev>
2023-04-06 11:38:42 -07:00
Antonio Scandurra ef04dc14cc Update file on incomplete buffer instead of waiting for it to be opened
This ensures that two successive file updates coming from the host are
not applied in reverse order.
2023-04-06 17:48:44 +02:00
Antonio Scandurra 8020ea783f Wait to see guest's buffer version before converting completion anchor 2023-04-06 16:23:10 +02:00
Antonio Scandurra 4a61e2dfa4 Save server operations that were in the middle of being applied
Previously, if the test panicked before it had a chance to fully
apply an operation, it would end up not being saved in the plan.
With this commit we will mark the operation as applied before we
start processing it, and mark it as not applied if, once we're done,
we've found out that it couldn't be applied. This is consistent with
what we do for client operations.
2023-04-06 16:02:16 +02:00
Antonio Scandurra f995d07542 Return error if subscribing to an entity that was already subscribed to 2023-04-06 14:42:19 +02:00
Antonio Scandurra d7f56d6126 Forget which buffers were shared when host reconnects
This fixes a bug where the host would momentarily disconnect and the guest
would close and reopen the project. This would cause the host to not observe
the guest closing the project. When the guest tried to open one of the
buffers opened prior to closing the project, the host would not send them the
buffer state because it would still remember that the buffer was shared.

The `shared_buffers` map is now cleared when the host reconnects and will slowly
get re-filled as guests issue `SynchronizeBuffers` requests.
2023-04-06 13:49:09 +02:00
Joseph Lyons 4883ec2201 Add close items to left and right 2023-04-06 03:33:38 -04:00
Max Brunsfeld bf3b8adf35 Avoid async fs call before checking if operation is applicable
This way, the executor isn't influenced by operations that aren't applicable.
2023-04-05 18:11:33 -07:00
Max Brunsfeld 1064b14779 Don't use TestPlan's rng in fake LSP handlers
These should use the test context's rng, so that they behave the same whether
a pre-recorded plan was used, or the plan is being generated.
2023-04-05 17:50:04 -07:00
Max Brunsfeld 2d63ed3ca4 Merge branch 'main' into randomized-tests-operation-script 2023-04-05 17:10:20 -07:00
Max Brunsfeld bda7086220 Clear guest's shared buffers if they rejoin project after leaving while host was disconnected 2023-04-05 16:53:36 -07:00