Commit Graph
327 Commits
Author SHA1 Message Date
Nathan SoboandMax Brunsfeld 8b684e14dc Don't try keychain after authentication fails
Previously, we were achieving this by deleting the keychain item, but this can sometimes fail which leads to an infinite loop. Now, we explicitly never try the keychain when reattempting authentication after authentication fails.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-23 12:15:36 -06:00
Antonio Scandurra 2fea8a3cda Stop following when leader disconnects 2022-03-22 11:16:04 +01:00
Antonio Scandurra 0de3f0980f Automatically unfollow when editing, scrolling or changing selections 2022-03-22 09:17:01 +01:00
Antonio Scandurra d37930e006 Serialize initial follow state in leader and reflect it in follower 2022-03-18 10:22:13 +01:00
Max Brunsfeld 6360072b43 WIP 2022-03-17 17:53:49 -07:00
Antonio ScandurraandNathan Sobo 8392138618 Start defining follow protocol
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 16:50:29 +01:00
Antonio ScandurraandNathan Sobo 53d7dfb195 Introduce workspace::register_project_item
This lets downstream crates like `editor` define how project items should be
opened.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:54:34 +01:00
Antonio ScandurraandNathan Sobo c9524e63a0 Remove Editor::find_or_create
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-17 15:13:47 +01:00
Antonio Scandurra ac220025d8 Rename open_buffer_for_path to open_buffer 2022-03-17 11:42:13 +01:00
Nathan SoboandMax Brunsfeld e5b82e80da WIP: Massage opening of editors
Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
2022-03-16 17:40:09 -06:00
29ab1f30bc Replace ProjectEntry struct with ProjectEntryId
Previously, we tracked the worktree_id and entry_id separately, but now that entry ids are unique across all worktrees this is unnecessary.

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-Authored-By: Keith Simmons <keith@the-simmons.net>
2022-03-16 15:59:47 -06:00
4c7d18530a Remove workspace::Item trait
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
Co-Authored-By: Keith Simmons <keith@zed.dev>
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2022-03-16 13:34:06 -07:00
Antonio ScandurraandNathan Sobo 1816b44648 Fade out unnecessary code
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:51:59 +01:00
Antonio ScandurraandNathan Sobo f37b22212f Implement shift-f8 to go to previous diagnostic
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-15 15:13:23 +01:00
Max BrunsfeldandKeith Simmons d5a8001155 Open settings file in new window if current window isn't local
Co-Authored-By: Keith Simmons <keith@zed.dev>
2022-03-14 17:12:07 -07:00
Max Brunsfeld 76ef5941e5 Ensure that worktrees' entry ids are unique across the project
Fixes #512
2022-03-14 12:36:56 -07:00
Max Brunsfeld 839a7f8782 Start work on relaying settings to language servers 2022-03-11 17:36:27 -08:00
Antonio Scandurra 583377a39d Don't starve main thread when lots of messages/events arrive at once 2022-03-11 10:09:13 +01:00
Antonio Scandurra 6454b09051 Show the last in-progress task from language servers 2022-03-11 09:59:13 +01:00
Antonio Scandurra 22b3216d65 Extract a LanguageServerStatus struct 2022-03-10 18:43:56 +01:00
Antonio Scandurra 7498e16311 Display language server name in status bar 2022-03-10 16:48:43 +01:00
Antonio Scandurra 00bd2967ae Render pending language server work in status bar 2022-03-10 16:09:47 +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
Antonio Scandurra fd5218858d Remove delegate support from GPUI
We added this because we thought it would save some allocations when
sending operations given that we could move them to the delegate upon
notifying it, but the reality is that we serialize operations and that
only requires a reference.
2022-03-09 10:48:52 +01:00
Antonio Scandurra b1001b0759 Notify all language servers only when a buffer is saved
Other notifications such as opening, closing or changing a document
are still tied to the buffer's language.
2022-03-09 10:44:03 +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 b130318ee7 Move DidSaveTextDocument notification from Buffer to Project 2022-03-08 11:35:54 +01: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
Max BrunsfeldandNathan Sobo 8529a10317 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
Nathan Sobo 07a018e001 Merge branch 'main' into disconnected-status 2022-03-04 10:07:26 -07:00
Antonio ScandurraandNathan Sobo 3390e055b9 Render overlay after remote project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:28:18 +01:00
Antonio Scandurra c51e8eb267 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 a8a5865e56 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 aa62426ee8 Support formatting in fake LSP capabilities 2022-03-04 11:24:18 +01:00
Antonio Scandurra 8692e322a3 Use LSP range formatting when document formatting is not available 2022-03-04 10:13:17 +01:00
Antonio Scandurra 3ad7272559 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
Max Brunsfeld ee589d9cf7 Avoid infinite loop when a language server fails to start 2022-03-03 18:13:38 -08:00
Max Brunsfeld 9543079660 Wait for LSP capabilities to be initialized before checking them 2022-03-03 15:59:03 -08:00
Max BrunsfeldandNathan Sobo c52c48c72e 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
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 94f4cc2b65 Ignore diagnostics received for invisible worktrees 2022-03-03 13:58:55 +01:00
Antonio Scandurra e18e172cda Move several buffer-related messages to the background 2022-03-03 12:18:19 +01:00
Antonio Scandurra b9a3204b18 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 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 a6098a93ce Check projects' buffers have unique absolute paths in random collab test 2022-03-02 14:38:16 -08:00