Commit Graph
10342 Commits
Author SHA1 Message Date
Piotr Osiewicz 39a30ba7b3 fixup! Remove stacks from branch list header 2023-07-05 14:08:21 +02:00
Piotr OsiewiczandAntonio 6c6c87f026 Remove stacks from branch list header
Co-authored-by: Antonio <antonio@zed.dev>
2023-07-05 14:04:16 +02:00
Piotr Osiewicz c4de04454f Remove PickerEvent::Dismiss emission from picker header 2023-07-04 16:30:17 +02:00
Piotr Osiewicz 833ed41fa8 Fix click behaviour of vcs/project dropdowns 2023-07-04 16:00:59 +02:00
Piotr Osiewicz c8f902715c branch list: dismiss correct window on PickerEvent.
Query proper window
2023-07-03 19:22:43 +02:00
Piotr Osiewicz a66ff10080 Merge branch 'main' into git-menu 2023-07-03 16:25:36 +02:00
Piotr Osiewicz 665e95c55f Remove flex from underneath the pickers 2023-07-03 16:16:14 +02:00
Kirill Bulatov ad05e47e7b Do not add extra spaces to hints (#2671)
Closes
https://linear.app/zed-industries/issue/Z-2526/inlay-hints-in-typescript-types-have-extra-space-before#comment-ac88a101

Release Notes:

- N/A
2023-07-03 11:18:07 +03:00
Kirill Bulatov a66f2a8be9 Do not add extra spaces to hints 2023-07-03 11:17:12 +03:00
Piotr Osiewicz 9580f67e6e Dismiss dropdowns on click out 2023-07-01 01:49:00 +02:00
Piotr Osiewicz dfe2ec31bf Render match count next to branch label 2023-07-01 01:38:36 +02:00
Kirill Bulatov 45d9dd5f73 Remove excessive hint update queries (#2667)
Closes
https://linear.app/zed-industries/issue/Z-2513/panic-in-refresh-inlay-hints

* Filter out queries for outdated buffers just before hint tasks spawn:
  multicaret edits might emit standalone events simultaneously
* Only spawn inlay update tasks for visible buffers with corresponding
  language
* Do not spawn tasks for local projects' buffers without LSP servers

Release Notes:

- N/A
2023-06-30 22:15:36 +03:00
Kirill Bulatov 1a5f3c1991 Remove excessive hint update queries
* Filter out queries for outdated buffers just before hint tasks spawn:
  multicared edits might empit standalone events simultaneously
* Only spawn inlay update tasks for visible buffers with corresponding
  language
* Do not spawn tasks for local projects' buffers without LSP servers
2023-06-30 22:03:21 +03:00
Max Brunsfeld c57609f656 Fix regression in handling git FS events (#2670)
As part of an optimization in
https://github.com/zed-industries/zed/pull/2663, I changed the way that
the worktree ignores FS events within unloaded directories. But this
accidentally prevented us from detecting some events that occur inside
of `.git` directories.

In this PR, I've made further tweaks to which FS events we can ignore.
We now explicitly opt *in* to scanning `.git` (shallowly) directories
(even though they are ignored). Note that we still don't recursively
scan the git directory (including all of the files inside `objects`
etc). This seems like the correct amount of work to do, and from my
testing (and our unit tests that use the real FS and real git
repositories), it seems to work correctly.

Release Notes:

- Fixed a bug where Zed would not detect some git repository changes
(preview only).
2023-06-30 11:40:49 -07:00
Max Brunsfeld a7fc19a618 Fix accidental ignoring of git FS events 2023-06-30 11:20:50 -07:00
Piotr Osiewicz c96d7dd8b9 Add missing rust-side definitions 2023-06-30 20:09:30 +02:00
Piotr Osiewicz 49fe2dffd2 Add styles for project name/git menu 2023-06-30 20:07:44 +02:00
Piotr Osiewicz fc0b3af10c Focus dropdowns on open 2023-06-30 19:48:28 +02:00
Joseph T. Lyons a063147641 Fix bug preventing the assist command from working in certain keymaps (#2669)
Fixes: https://github.com/zed-industries/community/issues/1712

The keymaps were adding in a `"cmd-enter": "editor::NewlineBelow",`
entry in the context of `Editor`, and this was clobbering the assist
command in the assistant panel context. Zed now defines this command in
the default keymap under the context of `"context": "Editor && mode ==
full"`. All I needed to basically do was remove that command from the
keymaps. I also removed the `"cmd-shift-enter": "editor::NewlineAbove"
from the `Editor` context in those keymaps as wel, as it is also defined
in the default keymap.

Release Notes:

- Fix bug preventing the `assistant: assist` command from working in
certain keymaps
2023-06-30 13:32:42 -04:00
Joseph T. Lyons 759bec286e Fix bug preventing the assist command from working in certain keymaps 2023-06-30 13:27:48 -04:00
Mikayla Maki a1e16f58d9 WIP: Add the ability to make new directories by adding slashes to a file name (#2638)
This PR adds a new way to make files / directories in the project panel,
by writing a path instead of a file.

TODO:
- [x] Solve a race condition that sometimes causes the newly created
file to not be selected / expanded correctly.
- [x] Change file refreshes to be minimal

Release Notes:

- Adds the ability to create new folders in the create-file action
([743](https://github.com/zed-industries/community/issues/743))
2023-06-30 07:46:32 -07:00
Piotr Osiewicz 748d966b9d Improve styling of git menu 2023-06-30 16:38:38 +02:00
Piotr Osiewicz afa9eeb3c5 Add styles to git menu 2023-06-30 16:23:27 +02:00
Piotr Osiewicz 77f595d98c Switch branches within spawn() 2023-06-30 14:05:55 +02:00
Piotr Osiewicz b53e9e2e4e Add missing call to cx.notify 2023-06-30 14:05:55 +02:00
Piotr OsiewiczandMikayla d38a93bbb5 Do not query db on foreground thread.
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-06-30 14:05:55 +02:00
Piotr Osiewicz d33d6377e0 Make project dropdown exclusive wrt git menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz de2a7c34d7 Project dropdown menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 9a20f6ac23 Fix warning about unused variable 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 45b6a798f3 Update toast for checkout failure 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 3dcb6ee47f Trail off project/branch name 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 45ac441910 Remove unnecessary imports 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 418aa42ea7 Fix build after rebase 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 1adbd8c6d7 Add toast for git checkout failure 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 9a8f668cf1 List recent branches 2023-06-30 14:05:55 +02:00
Piotr Osiewicz cdab13dd6c Add timestamps to branches 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 92a0ca0cc4 Trail off branch names 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 6be3982138 Render header and footer of git menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz 4b369afbc8 WIP: git menu 2023-06-30 14:05:55 +02:00
Mikayla Maki 591d6643a2 Fix method header 2023-06-29 23:53:57 -07:00
Mikayla Maki d228dc2d8a fix failing test 2023-06-29 23:50:24 -07:00
Mikayla Maki 9cbcdeb523 Added more tests and minimal file updates 2023-06-29 18:21:35 -07:00
Mikayla Maki 6584785a50 Make path updates minimal 2023-06-29 18:15:40 -07:00
Mikayla Maki 91f2a5401c fmt and update dependency 2023-06-29 17:49:42 -07:00
Mikayla Maki 742da534a2 Fix edge case with absolute file paths 2023-06-29 17:48:01 -07:00
Mikayla Maki f416d9ef00 Add the ability to make new directories by adding slashes to a file name 2023-06-29 17:35:22 -07:00
Mikayla Maki fef68e8480 Add click out events to GPUI (#2659)
This PR adds a new mouse event type for catching when a click happens
outside of a given region.

This was added because I noticed a 'race condition' between the context
menu and the buttons which deploy a context menu. Buttons use on
an`on_click()` handler to deploy the context menu, but the context menu
was closing itself with an `on_down_out()` handler. This meant that the
order of operations was:

0. Context menu is open
1. User presses down on the button, _outside of the context menu_ 
2. `on_down_out()` is fired, closing the context menu
3. User releases the mouse
4. `click()` is fired, checks the state of the context menu, finds that
it's closed, and so opens it

You can see this behavior demonstrated with this video with a long-click
here:


https://github.com/zed-industries/zed/assets/2280405/588234c3-1567-477f-9a12-9e6a70643527

~~Switching from `on_down_out()` to `on_click_out()` means that the
click handler for the button can close the menu before the context menu
gets a chance to close itself.~~

~~However, GPUI does not have an `on_click_out()` event, hence this
PR.~~

~~Here's an example of the new behavior, with the same long-click
action:~~


https://github.com/zed-industries/zed/assets/2280405/a59f4d6f-db24-403f-a281-2c1148499413

Unfortunately, this `click_out` is the incorrect event for this to
happen on. This PR now adds a mechanism for delaying the firing of a
cancel action so that toggle buttons can signal that this on_down event
should not result in a menu closure.

Release Notes:

* Made context menus deployed from buttons toggle, instead of
hide-and-re-show, visibility on click
2023-06-29 17:33:37 -07:00
Mikayla Maki 8eca1fdbb8 fmt 2023-06-29 17:19:35 -07:00
Mikayla Maki 74fefb0002 Remove on_click_out handler from context menu
Add 'delay_cancel()' method and on_down handler to relevant buttons
2023-06-29 17:10:51 -07:00
Kirill Bulatov 023ede7a5c Support basic inlay hints (#2660)
Part of https://github.com/zed-industries/community/issues/138
Part of https://linear.app/zed-industries/issue/Z-477/inlay-hints

Supports LSP requests for inlay hints, LSP /refresh request to reload
them.
Reworks DisplayMap and underlying layer to unite suggestions with inlay
hints into new, `InlayMap`.
Adds a hint cache inside `Editor` that tracks buffer/project/LSP request
events, updates the hints and ensures opened editors are showing up to
date text hints on top.

Things left to do after this PR:
* docs on how to configure inlay hints
* blogpost
* dynamic hints: resolve, hover, navigation on click, etc.

Release Notes:

- Added basic support of inlay hints
2023-06-29 22:49:39 +03:00