Commit Graph
206 Commits
Author SHA1 Message Date
Max Brunsfeld d2a4b6888c Store settings as a global via a gpui app_state 2022-03-11 15:58:58 -08:00
Antonio Scandurra 7498e16311 Display language server name in status bar 2022-03-10 16:48:43 +01:00
Antonio Scandurra 212fb05f33 Listen to all LSP progress notifications and broadcast them to peers 2022-03-10 12:00:33 +01:00
Antonio Scandurra 180c7dabff Split language server initialization from construction
This gives clients a chance to register to notifications.
2022-03-09 12:31:21 +01:00
Max Brunsfeld bfc721db27 Assign buffer's completion triggers from LSP capabilities
Also, make LanguageServer::new() async. The future resolves
once the server is initialized.
2022-03-08 17:41:52 -08:00
111d5305ea Remove language servers from buffers
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-08 15:16:07 -08:00
Antonio Scandurra f752458c55 Remove unused CloseBuffer message 2022-03-08 11:17:20 +01:00
Antonio Scandurra a26a8fca8a Send buffer operations via the Project instead of Worktree 2022-03-08 11:11:25 +01:00
1cd9a3244a Populate environment from shell
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-07 16:39:50 -08:00
a5c807cd7a Reset peer's receive timeout when a message is received
* Make advance_clock more realistic by waking timers in order,
  instead of all at once.
* Don't advance the clock when simulating random delays.

Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-07 15:33:43 -08:00
Max Brunsfeld 86d1ba1d65 Fix errors from conditional compilation in timer functions 2022-03-04 17:16:17 -08:00
Max Brunsfeld 310269e0d6 Adjust test connection to treat the half-open state more realistically
When a network connection is lost without being explicitly closed by the
other end, writes to that connection will error, but reads will just wait
indefinitely.

This allows the tests to exercise our heartbeat logic.
2022-03-04 16:47:55 -08:00
b2112ad40e Send websocket pings from both the client and the server
Remove the client-only logic for sending protobuf pings.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-04 15:21:18 -08:00
Antonio Scandurra f25602bcab Maintain remote worktrees correctly when building updates
This accidentally regressed in 660aa24.
2022-03-03 16:13:17 +01:00
Antonio Scandurra e18e172cda Move several buffer-related messages to the background 2022-03-03 12:18:19 +01:00
Antonio Scandurra 9ba036275a Change the definition of check_invariants
- On the host, ensure that only one worktree can exist for a given absolute
path. Asserting about buffers was cool but I think should be tackled in the
context of leaning more on entry ids for collaboration (vs. buffer ids).
- On the guest, ensure that all the opened buffers don't contain deferred
operations.
2022-03-03 10:51:37 +01:00
Antonio Scandurra 660aa24cc4 Ensure worktree is registered/shared synchronously 2022-03-03 10:10:53 +01:00
Max Brunsfeld bfba64ddb7 Tweak log format in random collab test 2022-03-02 14:38:16 -08:00
Max Brunsfeld a6098a93ce Check projects' buffers have unique absolute paths in random collab test 2022-03-02 14:38:16 -08:00
Antonio ScandurraandMax Brunsfeld 819bf72dfc Rename weak to visible
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-02 14:38:16 -08:00
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