Commit Graph
3133 Commits
Author SHA1 Message Date
Antonio Scandurra 6e2d4d2f99 Merge pull request #543 from zed-industries/fix-closing-items
Ensure `active_item_index` doesn't go off the end when closing items
2022-03-05 15:03:05 +01:00
Antonio Scandurra b19c323ea4 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 3c4f60c5e9 Merge pull request #538 from zed-industries/close-inactive-items
Implement close inactive items
2022-03-05 10:35:22 +01:00
Nathan Sobo 7788091086 Merge pull request #537 from zed-industries/disconnected-status
Render overlay after remote project becomes read-only
2022-03-04 10:39:43 -07:00
9d679d3dff 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
5472b19b46 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 07a018e001 Merge branch 'main' into disconnected-status 2022-03-04 10:07:26 -07:00
Nathan SoboandAntonio Scandurra e6815f2bde Fix tests after font update
Co-Authored-By: Antonio Scandurra <me@as-cii.com>
2022-03-04 10:06:21 -07:00
Antonio ScandurraandNathan Sobo 6804d9c5d6 🎨
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:54:48 +01:00
Antonio ScandurraandNathan Sobo 4892dcd9a0 Disable events when project becomes read-only
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-04 17:37:37 +01:00
Antonio ScandurraandNathan Sobo 22abec451f 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 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
Nate Butler 209712c6e5 Merge pull request #535 from zed-industries/update-zed-fonts
Update zed fonts to 1.2.0
2022-03-04 11:18:18 -05:00
Nate Butler 7a6d78a7e1 Update zed fonts to 1.2.0 2022-03-04 11:05:34 -05: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 1a215eb43d Merge pull request #533 from zed-industries/range-formatting
Use LSP range formatting when document formatting is not available
2022-03-04 16:12:59 +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
Antonio Scandurra a9a0df58c0 Observe selection set lamport timestamps when deserializing buffer 2022-03-04 09:34:30 +01:00
Antonio Scandurra 64acd485c0 Allow receiving diagnostic updates out of order 2022-03-04 09:27:49 +01:00
Max Brunsfeld 34bc06d142 Merge pull request #532 from zed-industries/handle-language-server-failure
Avoid infinite loop when a language server fails to start
2022-03-03 20:58:35 -08:00
Max Brunsfeld ee589d9cf7 Avoid infinite loop when a language server fails to start 2022-03-03 18:13:38 -08:00
Max Brunsfeld 3a1a9ecb45 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 14d7f86c62 Merge pull request #526 from zed-industries/json
Add basic JSON support
2022-03-03 16:07:04 -08:00
Max Brunsfeld 9543079660 Wait for LSP capabilities to be initialized before checking them 2022-03-03 15:59:03 -08:00
Max Brunsfeld 5072109d9d Make fake language servers have full capabilities 2022-03-03 15:42:29 -08:00
Max BrunsfeldandNathan Sobo 5868120184 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 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
Max BrunsfeldandNathan Sobo b5800767f1 Add JSON language server
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-03 13:29:25 -08:00
Max BrunsfeldandNathan Sobo 56dbc3f44e 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
b36faed34e 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 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 7470cadc51 Move code action and completion edit messages to the background 2022-03-03 13:54:26 +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 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
Max Brunsfeld 0361877185 Rename strong_worktrees -> visible_worktrees 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
5ca65a46c7 Move SearchProject to the background
Co-Authored-By: Max Brunsfeld <max@zed.dev>
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
2022-03-02 14:38:16 -08:00
Antonio ScandurraandMax Brunsfeld cc0f11fb08 Convert weak worktree handles into strong handles when sharing
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2022-03-02 14:38:16 -08:00
Max Brunsfeld 8f92c2735b 0.18.1 2022-03-02 14:23:19 -08:00
Max Brunsfeld 6762c7f819 Merge pull request #523 from zed-industries/no-cmd-ctrl-input
Don't insert input into editors when control or command keys are held
2022-03-02 14:19:54 -08:00
Max Brunsfeld 6d89c1c69e Don't insert input into editors when control or command keys are held
This is a follow-up to #475
2022-03-02 14:09:46 -08:00
Antonio Scandurra 4675ae8fa3 Merge pull request #517 from zed-industries/activate-pane-when-activating-item
Make pane active when activating one of its items
2022-03-02 17:33:12 +01:00