Commit Graph

11794 Commits

Author SHA1 Message Date
Conrad Irwin
bde67b2b9c Fix merge-conflict 2023-08-25 11:59:16 -06:00
Conrad Irwin
1c945a7521
Fix zed-industries/community#1950 (#2892)
Release Notes:

- vim: fix goal preservation of visual block selections
([#1950](https://github.com/zed-industries/community/issues/1950)).
2023-08-25 11:55:48 -06:00
Conrad Irwin
f18cdcba54 Fix relative line numbers in vim visual mode
In visual mode when your selection ends with a newline we show the
cursor at the end of the previous line (not the start of the current
line). We had only been accounting for this if the cursor was on-screen.
2023-08-25 11:50:41 -06:00
Conrad Irwin
8d5dc266a3 Fix relative line numbers when newest cursor offscreen 2023-08-25 11:50:41 -06:00
Conrad Irwin
790aa5d476 Add relative_line_mode
Co-Authored-By: joseph@zed.dev
2023-08-25 11:50:41 -06:00
Conrad Irwin
1f3e009b32 Fix zed-industries/community#1950 2023-08-25 11:34:07 -06:00
Max Brunsfeld
f798be6e27 Fix rust 1.72 warnings about shadowed glob re-exports 2023-08-25 10:25:21 -07:00
Max Brunsfeld
404f76739c Format let-else statements 2023-08-25 10:11:32 -07:00
Max Brunsfeld
732af201dc Upgrade to rust 1.72 2023-08-25 09:59:16 -07:00
Antonio Scandurra
7c5200e757 More styling 2023-08-25 17:51:13 +02:00
Antonio Scandurra
c4966ff57a Remove warning 2023-08-25 17:35:14 +02:00
Antonio Scandurra
75a6a94e96 Add placeholder text for inline assistant prompts 2023-08-25 17:24:26 +02:00
Kirill Bulatov
44c340b5f2 Properly invalidate the hint cache 2023-08-25 17:33:17 +03:00
Antonio Scandurra
b101a7edff Cancel last inline assist when escaping from the editor 2023-08-25 15:54:52 +02:00
Antonio Scandurra
fdbf4680bb Ensure the inline assistant works with gpt-3.5 2023-08-25 15:39:10 +02:00
Kirill Bulatov
205e101dd0
Query certain editor ranges for inlays with a delay (#2891)
Part of
https://linear.app/zed-industries/issue/Z-2750/investigate-performance-of-collaborating-on-large-files-with-inlay
Fixes
https://linear.app/zed-industries/issue/Z-2824/inlay-hints-affect-code-layout-in-multibuffer

We query hints for visible part of the screen, and two parts above and
below the visible range, of the same range (if applicable, we can be on
the edge of the document).

When rapidly typing, we do not care about the invisible range updates,
yet still query a lot of them + rust-analyzer sends /refresh hint
requests shortly after every modification too, forcing us to re-query.

Instead querying both visible and invisible ranges altogether, wait for
visible range query first and wait add a `400ms` delay afterwards before
querying the invisible ranges.
This allows any /refresh requests or rapid typing to avoid 2 extra
requests, cancelling them before they start.
Visible part of the screen is still queried after every change, without
any debouncing.

Release Notes:

- Delay certain inlay hint requests to reduce general LSP server load
2023-08-25 16:33:21 +03:00
Kirill Bulatov
2b95f0580e Fix the tests 2023-08-25 16:25:43 +03:00
Kirill Bulatov
c10c3e2b54 Only invalidate when doing first, visible range query 2023-08-25 15:16:55 +03:00
Kirill Bulatov
a63e1571dc Defer querying inlay hints for invisible editor ranges
This way, only the visible part gets frequently queried on typing (and
hint /refresh requests that follow), with queries for invisible ranges
cancelled eagerly.
2023-08-25 15:16:55 +03:00
Kirill Bulatov
b50762c821
Handle inlay hints resolve, support dynamic hints (#2890)
Resolves inlay hints on hover, shows hint label parts' tooltips, allows
cmd+click to navigate to the hints' parts with locations,
correspondingly highlight the hints.

Release Notes:

- Support dynamic inlay hints
2023-08-25 15:16:13 +03:00
Kirill Bulatov
0a18aa694f Use stricter inlay range checks to avoid stuck highlights
Often, hint ranges are separated by a single '<` char as in
`Option<Vec<u32>>`. When moving the caret from left to right, avoid
inclusive ranges to faster update the matching hint underline.
2023-08-25 14:46:39 +03:00
Antonio Scandurra
27c90f12f6 Merge remote-tracking branch 'origin/main' into ai-refactoring 2023-08-25 13:37:32 +02:00
Antonio Scandurra
0444b5a775 💄 2023-08-25 13:36:52 +02:00
Kirill Bulatov
8ed280a029 Rebase fixes 2023-08-25 14:30:07 +03:00
Kirill Bulatov
e44516cc6c Add hover tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov
f19c659ed6 Add link_go_to_definition test for inlays 2023-08-25 14:26:17 +03:00
Kirill Bulatov
abd2d012b1 Properly binary search cached inlay hints 2023-08-25 14:26:17 +03:00
Kirill Bulatov
3c55c933d4 Be more lenient with hint resolution, always return some hint 2023-08-25 14:26:17 +03:00
Kirill Bulatov
852427e87b Use inlay highlights in randomized tests 2023-08-25 14:26:17 +03:00
Kirill Bulatov
7cd60d6afb Simplify and restore client resolve capabilities 2023-08-25 14:26:17 +03:00
Kirill Bulatov
dcf570bb03 Fix resolve status conversion 2023-08-25 14:26:17 +03:00
Kirill Bulatov
bcaff0a18a Propagate inlay background highlights to data storage 2023-08-25 14:26:17 +03:00
Kirill Bulatov
4b78678923 Prepare background highlights for inlay highlights 2023-08-25 14:26:17 +03:00
Kirill Bulatov
12ffbe54fb Unify text and inlay highlights 2023-08-25 14:26:17 +03:00
Kirill Bulatov
420f8b7b15 Prepare for inlay and text highlight unification 2023-08-25 14:26:17 +03:00
Kirill Bulatov
4cc9f2f525 Highlight inlay hint parts on cmd-hover
Co-Authored-By: Antonio <antonio@zed.dev>
2023-08-25 14:26:17 +03:00
Kirill Bulatov
f8874a726c Attempt to highlight inlays 2023-08-25 14:26:17 +03:00
Kirill Bulatov
6c5761d05b Pass inlay highlight information 2023-08-25 14:26:17 +03:00
Kirill Bulatov
477fc865f5 Properly resolve inlay label parts' locations and buffers 2023-08-25 14:26:17 +03:00
Kirill Bulatov
7eab18ec89 Pass inlay go to definition data 2023-08-25 14:26:17 +03:00
Kirill Bulatov
ac86bbac75 Prepare for hover functionality refactoring 2023-08-25 14:26:17 +03:00
Kirill Bulatov
80e8714241 Send inlay hint resolve requests 2023-08-25 14:26:17 +03:00
Kirill Bulatov
3434990b70 Store inlay hint resolve data 2023-08-25 14:26:17 +03:00
Kirill Bulatov
e4b78e322e Revert "Strip off inlay hints data that should be resolved"
Without holding all hints in host's cache, this is impossile.
Currenly, we keep hint caches separate and isolated, so this will not
work when we actually resolve.
2023-08-25 14:26:17 +03:00
Kirill Bulatov
d1cb0b3c27 Properly detect hovered inlay hint label part 2023-08-25 14:26:17 +03:00
Kirill Bulatov
d34491e822 Draft inlay hint part hover detection 2023-08-25 14:26:17 +03:00
Antonio Scandurra
971c833e80 Improve background highlighting of inline assists 2023-08-25 12:35:36 +02:00
Antonio Scandurra
144f5c5d41 Use a left bias for the prompt editor 2023-08-25 12:25:43 +02:00
Antonio Scandurra
66a496edd7 Allow generating code without editing it 2023-08-25 12:16:28 +02:00
Antonio Scandurra
c1bd035875 Rework inline assistant 2023-08-25 11:39:27 +02:00