Commit Graph

10318 Commits

Author SHA1 Message Date
Piotr Osiewicz
525521eeb3 Render match count next to branch label 2023-07-01 01:38:36 +02:00
Piotr Osiewicz
7c2c1a279b Add missing rust-side definitions 2023-06-30 20:09:30 +02:00
Piotr Osiewicz
cec884b5a5 Add styles for project name/git menu 2023-06-30 20:07:44 +02:00
Piotr Osiewicz
a5d9a10d7b Focus dropdowns on open 2023-06-30 19:48:28 +02:00
Piotr Osiewicz
ed75c31640 Improve styling of git menu 2023-06-30 16:38:38 +02:00
Piotr Osiewicz
b699e5c142 Add styles to git menu 2023-06-30 16:23:27 +02:00
Piotr Osiewicz
3be8977ee8 Switch branches within spawn() 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
c1a6292152 Add missing call to cx.notify 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
081e340d26 Do not query db on foreground thread.
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-06-30 14:05:55 +02:00
Piotr Osiewicz
818ddbc703 Make project dropdown exclusive wrt git menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
888d3b3fd6 Project dropdown menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
d000ea9739 Fix warning about unused variable 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
1eb0f3d091 Update toast for checkout failure 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
98f71a7fa3 Trail off project/branch name 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
e57364ede6 Remove unnecessary imports 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
aeafa6f6d6 Fix build after rebase 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
c84f3b3bfc Add toast for git checkout failure 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
54fad5969f List recent branches 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
3027e4729a Add timestamps to branches 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
6747acbb84 Trail off branch names 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
ac6e9c88e9 Render header and footer of git menu 2023-06-30 14:05:55 +02:00
Piotr Osiewicz
d8d0bdc479 WIP: git menu 2023-06-30 14:05:55 +02:00
Mikayla Maki
f6b64dc67a
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
73b0f3b23d
fmt 2023-06-29 17:19:35 -07:00
Mikayla Maki
5366631173
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
167dd1c5d2
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
Kirill Bulatov
b146762f68 Remove a flacky test, fix the failing one 2023-06-29 22:45:04 +03:00
Kirill Bulatov
652909cdba Post-rebase fixes 2023-06-29 22:39:33 +03:00
Kirill Bulatov
3445bc42b6 Invalidate refresh tasks better 2023-06-29 22:39:18 +03:00
Kirill Bulatov
98edc0f885 Simplify the hint cache code 2023-06-29 22:39:18 +03:00
Kirill Bulatov
083e4e76e2 Better tests, invalidate multibuffer excerpts better 2023-06-29 22:39:18 +03:00
Kirill Bulatov
943c93fda7 Simplify hint task queueing 2023-06-29 22:39:18 +03:00
Kirill Bulatov
30e77aa388 More inlay hint cache tests 2023-06-29 22:39:18 +03:00
Kirill Bulatov
429a9cddae Use fold points to go to display map's prev/next line boundary
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov
bb9ade5b6f Fix wrap map test
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov
2b59f27c3b Fix fold map tests
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov
0972766d1d Add more hint tests 2023-06-29 22:39:18 +03:00
Kirill Bulatov
15e0feb91d Move highlights from fold to inlay randomized tests 2023-06-29 22:39:18 +03:00
Kirill Bulatov
667b70afde Move hint settings on the language level 2023-06-29 22:39:18 +03:00
Kirill Bulatov
480d8c511b Theme hints and suggestions differently 2023-06-29 22:39:18 +03:00
Kirill Bulatov
3312c9114b Improve inlay hint highlights
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-06-29 22:39:18 +03:00
Kirill Bulatov
2c54d926ea Test inlay hint cache 2023-06-29 22:39:18 +03:00
Nate Butler
143a020694 Update Hint Style
zzz
2023-06-29 22:39:17 +03:00
Kirill Bulatov
67214f0e55 Only skip /refresh inlay queries when vislble range is not updated 2023-06-29 22:25:50 +03:00
Kirill Bulatov
096bad1f73 Revert useless changes, simplify 2023-06-29 22:25:50 +03:00
Antonio Scandurra
f77b680db9 Account for inlay biases when clipping a point 2023-06-29 22:25:50 +03:00
Antonio Scandurra
976edfedf7 Add Cursor::next_item 2023-06-29 22:25:50 +03:00
Kirill Bulatov
5c21ed4263 Properly filter out task hints 2023-06-29 22:25:50 +03:00
Kirill Bulatov
dfb30218ca Remove mutex usage from *Map contents 2023-06-29 22:25:50 +03:00
Kirill Bulatov
acef5ff195 Query hints when editors gets open and visible 2023-06-29 22:25:50 +03:00