Commit Graph

1372 Commits

Author SHA1 Message Date
Keith Simmons
b440a51675 Make theme selector eagerly display the selected theme 2022-03-08 18:42:31 -08:00
Antonio Scandurra
03aa906068 v0.19.0 2022-03-08 08:18:51 +01:00
Max Brunsfeld
5cc5fa2f93 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
Max Brunsfeld
bb6ab837cf
Merge pull request #542 from zed-industries/guest-disconnections
Send heartbeats in both directions so the server can detect when clients disconnect
2022-03-07 15:52:35 -08:00
Max Brunsfeld
1f5eab39a9 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
Antonio Scandurra
e579da64c3 WIP: Introduce a read timeout
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-07 17:08:12 +01:00
Nathan Sobo
40c0b9e7a5 Halt keystroke dispatch when a global action is dispatched 2022-03-06 09:46:33 -07:00
Antonio Scandurra
711de5edcb Ensure active_item_index doesn't go off the end when closing items
This fixes a bug introduced in #538, where closing the current tab would hide
all the other tabs, if the current tab was the last one.

Also, this commit manually sets the active item index instead of calling
`Pane::activate_item`: even though this introduces a little bit of duplication,
it prevents us from mistakenly calling `deactivate` on the wrong item. This would
happen because `activate_item` looks at `self.active_item_index` to determine
which item to deactivate before setting the new one. However, that index is
potentially invalid because `::close_items` manipulates the `item_views` vector,
so `activate_item` could end up calling `deactivate` on an item view that was
not active in the first place.
2022-03-05 10:52:55 +01:00
Antonio Scandurra
c7ddb66795
Merge pull request #538 from zed-industries/close-inactive-items
Implement close inactive items
2022-03-05 10:35:22 +01:00
Max Brunsfeld
4124308d94 Fix errors from conditional compilation in timer functions 2022-03-04 17:16:17 -08:00
Max Brunsfeld
fab115e549 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
Max Brunsfeld
9017a1363b 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
Max Brunsfeld
c61a1bd659 Make timer method available on both foreground and background executors
Also, make it return a static future.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 13:54:07 -08:00
Max Brunsfeld
1982a8c27d Put vector clock serialization logic alongside other serialization logic
This way, the `clock` crate doesn't depend on the `rpc` crate.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 13:54:07 -08:00
Max Brunsfeld
28bacabc4e Move Network test helper from util crate into text crate
This way, `util` does not depend on `clock`.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 13:54:07 -08:00
Nathan Sobo
8b9f41175b Use the macOS standard binding instead of VS Code's
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-04 10:39:11 -07:00
Nathan Sobo
3057b38fad Implement close inactive items action
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-04 10:36:51 -07:00
Nathan Sobo
a72d58a28c Merge branch 'main' into disconnected-status 2022-03-04 10:07:26 -07:00
Nathan Sobo
d59451fb08 Fix tests after font update
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-04 10:06:21 -07:00
Antonio Scandurra
c38de3243d 🎨
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:54:48 +01:00
Antonio Scandurra
38313abc48 Disable events when project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:37:37 +01:00
Antonio Scandurra
77e913b5a4 Blur focused view when project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:37:26 +01:00
Antonio Scandurra
b21d91db22 Render overlay after remote project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:28:18 +01:00
Nate Butler
38e32f368d Update zed fonts to 1.2.0 2022-03-04 11:05:34 -05:00
Antonio Scandurra
6ee5e96d7b
Merge pull request #534 from zed-industries/create-buffers-via-project
Open untitled buffers via the `Project`
2022-03-04 16:18:02 +01:00
Antonio Scandurra
29cad65ce0 Open untitled buffers via the Project
This allows the registration of such buffers in the project, which is necessary
to correctly support `::save_buffer_as` and opens the door to sharing untitled
buffers with guests in the future.

Note that, for now, this disallows guests to create untitled buffers in the
current window and will create a new window instead. This is because we don't
yet have a global way of allocating a buffer's remote id (nor a way of saving
such buffers in the host's worktree) and we instead rely on the local model ID,
which could clash with the host's buffer IDs.

I think we should revisit this once guests can share their untitled buffers
with the host and other remote peers, as well as once we start keying
operations by entry id.
2022-03-04 15:25:39 +01:00
Antonio Scandurra
d8ef3a5d61 Support formatting in fake LSP capabilities 2022-03-04 11:24:18 +01:00
Antonio Scandurra
46da80d726 Use LSP range formatting when document formatting is not available 2022-03-04 10:13:17 +01:00
Antonio Scandurra
dc5a09b3f7
Merge pull request #525 from zed-industries/preserve-worktrees
Grow worktrees monotonically when sharing and move most messages to the background
2022-03-04 09:48:18 +01:00
Antonio Scandurra
7c420050c7 Observe selection set lamport timestamps when deserializing buffer 2022-03-04 09:34:30 +01:00
Antonio Scandurra
bcd5c28833 Allow receiving diagnostic updates out of order 2022-03-04 09:27:49 +01:00
Max Brunsfeld
19658139b1 Avoid infinite loop when a language server fails to start 2022-03-03 18:13:38 -08:00
Max Brunsfeld
05df1dfae9 Disable doctests for all libraries
We don't use them, and they add a lot of noise to the test output
when running all tests in the workspace.
2022-03-03 16:15:56 -08:00
Max Brunsfeld
3c242a43d2 Wait for LSP capabilities to be initialized before checking them 2022-03-03 15:59:03 -08:00
Max Brunsfeld
78d96a05fc Make fake language servers have full capabilities 2022-03-03 15:42:29 -08:00
Max Brunsfeld
9999862016 Enable formatting feature of JSON language server
The feature doesn't work yet because the JSON language server
only supports *range* formatting, not document formatting.
We need to adjust our code to inspect the server's capabilities
and send range formatting requests instead when needed.

We're going to hold off on doing this right now, because it
will create merge conflicts with the `preserve-worktrees`
branch (#525)

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-03 14:16:58 -08:00
Max Brunsfeld
81627a0f14 Avoid sending unhandled LSP requests to JSON language server
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-03 13:39:40 -08:00
Max Brunsfeld
0582c557e3 Add JSON language server
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-03 13:29:25 -08:00
Max Brunsfeld
bf1153cedd Add syntax highlighting/auto-indent/outlines for JSON files
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-03 12:12:18 -08:00
Antonio Scandurra
556d9cc53f Correctly defer undo operations when messages arrive out of order
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-03 18:07:59 +01:00
Antonio Scandurra
410ee124af Maintain remote worktrees correctly when building updates
This accidentally regressed in 53327e2.
2022-03-03 16:13:17 +01:00
Antonio Scandurra
c613b22619 Ignore diagnostics received for invisible worktrees 2022-03-03 13:58:55 +01:00
Antonio Scandurra
d0d6916167 Move code action and completion edit messages to the background 2022-03-03 13:54:26 +01:00
Antonio Scandurra
14d26eeedc Move several buffer-related messages to the background 2022-03-03 12:18:19 +01:00
Antonio Scandurra
1c14168f38 Ensure no two worktrees can point to the same root path
This could happen because there was a pause between creating the worktree
and adding it to the list of tracked local worktrees, and so we might end
up adding the same worktree twice when calling `create_local_worktree` in
rapid succession.
2022-03-03 10:54:52 +01:00
Antonio Scandurra
d171d8ccc4 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
53327e2bf0 Ensure worktree is registered/shared synchronously 2022-03-03 10:10:53 +01:00
Max Brunsfeld
530f15b46b Tweak log format in random collab test 2022-03-02 14:38:16 -08:00
Max Brunsfeld
d4ae38fcee Check projects' buffers have unique absolute paths in random collab test 2022-03-02 14:38:16 -08:00
Max Brunsfeld
ca920e1552 Rename strong_worktrees -> visible_worktrees 2022-03-02 14:38:16 -08:00