Commit Graph
198 Commits
Author SHA1 Message Date
Max Brunsfeld 0f8c49c773 Flush effects when dropping test clients in random collaboration test 2022-03-01 18:17:25 -08:00
Max Brunsfeld 4f2095a87c Remove stray printing in db tests 2022-03-01 12:10:35 -08:00
Max Brunsfeld 347d2ec27c Make integration tests depend only on a few core crates, not all of zed 2022-03-01 12:09:51 -08:00
62610cd4d9 Fix failure in test_unshare_project due to dropping handle outside of an update block
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-01 10:50:58 -08:00
Antonio Scandurra 87897cd3e8 Capture a weak reference to the Project in fake LSP 2022-03-01 13:34:03 +01:00
Antonio Scandurra 511fdc869f Don't block when emitting fs events
Blocking could happen while processing events, which would cause the
background scanner to never make any further progress.
2022-03-01 13:08:50 +01:00
Antonio Scandurra 6bd783fceb Remove project from host connection when unregistering it 2022-03-01 12:18:55 +01:00
Antonio Scandurra 79568c471a 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
Max BrunsfeldandNathan Sobo 3d5668c383 Try clearing Client's state at the ends of integration tests
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-28 22:52:21 -08:00
Max BrunsfeldandNathan Sobo 29edf2691a Clean up guest connection states correctly when a collaborator disconnects
This bug was caught by running the executor until parked after tests.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-28 22:21:32 -08:00
Max BrunsfeldandNathan Sobo fe6bc5e188 Start work on detecting leaked handles in tests
For now, just track models. Tests fail because we don't
yet clear the app contexts at the right time.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-28 22:02:43 -08:00
Max BrunsfeldandAntonio Scandurra 912613a5a1 Never close buffers when sharing
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-28 11:36:43 -08:00
Antonio Scandurra 24970776cf Don't use a bounded channel for signaling that buffers have been opened
Blocking the sender could halt deserialization for no reason if nobody
is consuming the notifications.
2022-02-28 15:26:10 +01:00
Antonio Scandurra 145c465796 Add project-wide search to randomized integration test 2022-02-28 14:22:31 +01:00
Antonio Scandurra 77d4c68f87 Include buffer's deferred ops when computing has_buffered_operations 2022-02-28 14:22:24 +01:00
Nathan SoboandMax Brunsfeld 288da2114c Extract generic forward_project_request function on server
All these methods did the same thing with different message types.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-25 15:20:42 -07:00
Nathan SoboandMax Brunsfeld d25da1a985 Handle project-wide search on guests
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-02-25 15:09:47 -07:00
Max BrunsfeldandNathan Sobo 20d923b53e Provide editor styling information separately from editor settings
* Since regular editors' font sizes and families are controlled by
  the settings and not the theme, don't store a dummy text style in
  the theme. Instead, only store a font color, and synthesize
  the text style for regular editors using both the theme and the
  settings.
* Style single-line and auto-height editors (now called "field
  editors") using a single function that takes the entire theme and
  selects a relevant sub-object.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-24 16:42:00 -08:00
Max Brunsfeld cd202e4e12 Open buffers from definitions request in random collab test
Don't try to open buffers from the weak worktrees directly, as this is
expected to fail if the host drops the buffer for that worktree.
2022-02-23 20:35:05 -08:00
Max Brunsfeld 5a544fa808 Remove unused pending_updates field from RemoteWorktree 2022-02-23 16:59:39 -08:00
Max Brunsfeld 551d493c05 Tweak logging in random collaboration test 2022-02-23 16:27:34 -08:00
Max BrunsfeldandNathan Sobo d9d10dffe3 Fix race conditions with LSP requests that return buffers
* Avoid panic when registering a buffer that was previously open,
  and whose weak handle was still present in the open_buffers map.
* Avoid releasing any buffers while a request is outstanding which
  could return a reference to a buffer.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-23 15:26:01 -08:00
ab28a5bb54 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 7a0e8560a3 WIP 2022-02-23 19:04:22 +01:00
58206d413c Remove update_id from worktree update messages
We don't need this anymore because worktree updates are foreground
messages.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-02-23 18:35:25 +01:00
Antonio Scandurra 02f215d953 Move document highlights RPC message to the background 2022-02-23 16:16:02 +01:00
Antonio Scandurra 919a280fab Pass an AsyncAppContext to fake language server request handlers 2022-02-23 16:14:36 +01:00
Max Brunsfeld ba2aa6798f Show document highlights from the language server when moving the cursor 2022-02-22 17:16:31 -08:00
Max BrunsfeldandNathan Sobo c5888616cc Implement find-all-references
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-22 14:27:16 -08:00
Max BrunsfeldandNathan Sobo 7a7f928d7b Add integration test for project symbols
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-22 12:44:17 -08:00
Max BrunsfeldandNathan Sobo c2953f4cf4 Request definitions as guests in random collaboration integration test
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-22 12:03:45 -08:00
b43945d6c6 Allow languages to be registered at any time
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-02-22 10:35:20 -08:00
Antonio Scandurra f8762ff1ce Allow opening of buffers associated with a project symbol 2022-02-22 16:26:01 +01:00
Antonio Scandurra 416898db0e Retrieve project symbols over RPC 2022-02-22 14:50:06 +01:00
Max BrunsfeldandNathan Sobo c9a4d76f2d Download language servers on-demand
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-21 13:54:52 -08:00
Antonio ScandurraandNathan Sobo ec875ff474 Show message indicating when we're downloading language servers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-21 17:25:52 +01:00
Antonio Scandurra c17dd8386f Merge pull request #455 from zed-industries/rename
Introduce rename support via `F2`
2022-02-19 11:07:39 +01:00
Max Brunsfeld d74d3f61a6 Tweak behavior of selections when renaming 2022-02-18 15:44:57 -08:00
Antonio Scandurra 099f4fab72 Replace Inconsolata with Zed Mono and Zed Sans 2022-02-18 14:55:11 +01:00
Antonio Scandurra e60b62f45f Add test for preparing and performing a rename 2022-02-18 12:18:01 +01:00
Antonio Scandurra 7a72d7aed7 Undo temporary edits before performing rename or canceling it
Also, wire up remote renames.
2022-02-18 11:41:47 +01:00
Max Brunsfeld 9479826046 Convert some project tests to use FakeFs
Also, tweak some FakeFs methods to make them slightly more convenient.
2022-02-17 11:09:27 -08:00
Antonio Scandurra fe8ef9e96d Use a fake database in tests 2022-02-17 17:04:04 +01:00
Antonio ScandurraandNathan Sobo bd04ebf421 Avoid parsing in randomized collaboration integration test
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-17 15:17:15 +01:00
Antonio ScandurraandNathan Sobo 960dff5dc9 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 fac5959ac2 Wait for version before returning completions 2022-02-17 11:41:19 +01:00
Antonio Scandurra f2881b5030 Avoid stalling server when test notifications aren't being processed 2022-02-17 10:38:56 +01:00
Antonio Scandurra 6016d827f2 Randomly detach requests on guest to let them race with other local ops 2022-02-17 09:05:06 +01:00
Max BrunsfeldandNathan Sobo 258542b74a Remove unnecessary waiting when handling save RPC requests
Add saving to the randomized integration test

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-16 17:47:21 -08:00
Max BrunsfeldandNathan Sobo e26a1e433c Remove waiting for edits when handling code action RPC requests
Add code actions to the randomized integration test

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-02-16 17:34:23 -08:00