Commit Graph
1059 Commits
Author SHA1 Message Date
Mikayla fe10875285 Fix panic on select all when query is empty 2023-09-20 17:10:23 -07:00
Mikayla fdf5278bbf Only autoscroll on select_next operations 2023-09-20 09:31:12 -07:00
Mikayla 8cc7a02390 Fix rebase 2023-09-20 08:34:18 -07:00
Mikayla 03d4191685 Fix infinite loop in select all matches 2023-09-20 08:25:21 -07:00
Mikayla c074bfd441 Add select all command to the editor, equivalent to hitting cmd-d as many times as possible 2023-09-20 08:25:20 -07:00
Piotr Osiewicz 616d328f3c chore: Use aho-corasick 1.1 in direct dependencies (#2983)
Nothing too fancy, we've depended indirectly on 1.0/1.1 already, so this
is essentially bookkeeping.

Release Notes:
- N/A
2023-09-18 17:01:08 +02:00
Nate Butler 24974ee2fa Unify icons using multiple variants, remove all unused icons 2023-09-15 12:50:49 -04:00
Kirill Bulatov 8ae3f79235 Restructure inlay highlights data for proper access 2023-09-14 23:05:22 +03:00
Kirill Bulatov 9b43acfc88 Remove useless background highlights code 2023-09-14 22:18:30 +03:00
Kirill BulatovandAntonio Scandurra a9de6c3dba Properly handle inlay highlights in the InlayMap
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-09-14 22:08:12 +03:00
Kirill Bulatov 42bd2be2f3 Implement inlay highlighting 2023-09-14 22:08:12 +03:00
Kirill Bulatov 890a587254 Use standalone inlay background highlights 2023-09-14 22:08:12 +03:00
Kirill Bulatov 9f5314e938 Unify highlights in *Map 2023-09-14 22:08:12 +03:00
Kirill Bulatov 6c00cd8a35 Do not combine inlay and text highlights on the *Map level 2023-09-14 22:08:12 +03:00
Piotr Osiewicz 1eb74acb3e editor: Do not run brace completion on empty text. (#2965)
Users of keyboard layout with IME complained about the peculiar
behaviour where typing in "sss" and then removing all of it left behind
one 's' and also appended a closing brace. This was not reproducible on
a buffer without language, so I've suspected that brace insertion might
be a problem here. For whatever reason when the user removes the last
character from a run that triggered IME, we receive a notification about
an empty insertion. Sadly, brace completion does not handle an empty
input properly and we erroneously insert a closing brace when deleting
the followup characters. In fact, the brace inserted is always the
closing brace for the first entry in language's config.toml 'brackets'
field (see Scheme vs Markdown). This guard also allows for the proper
removal of the first character.

Closes community tickets zed-industries/community#877
zed-industries/community#1329

Z-2869

Release Notes:
- Fixed handling of bracket completion for international keyboard
layouts that use IME. This led to Zed erroneously inserting the `}`
character while removing the first character that triggered IME.
2023-09-14 20:24:21 +02:00
Antonio Scandurra 70c9b8f8fd Merge remote-tracking branch 'origin/main' into polish-codegen 2023-09-13 11:41:32 +02:00
Antonio Scandurra 02078140c0 Extract code generation logic into its own module 2023-09-11 11:25:37 +02:00
Conrad Irwin 1b1d7f22cc Add visual area repeating 2023-09-07 10:45:38 -06:00
Conrad Irwinand 20f98e4d17 vim . to replay
Co-Authored-By: maxbrunsfeld@gmail.com
2023-09-06 13:49:55 -06:00
Conrad Irwin 56db21d54b Split ContextMenu actions
This should have no user-visible impact.

For vim `.` to repeat it's important that actions are replayable.
Currently editor::MoveDown *sometimes* moves the cursor down, and
*sometimes* selects the next completion.

For replay we need to be able to separate the two.
2023-09-02 21:04:19 -06:00
Conrad Irwin 6d7949654b Fix accidental visual selection on scroll
As part of this fix partial page distance calculations to more closely
match vim.
2023-09-01 11:14:27 -06:00
Julia ff3865a4ad Merge branch 'main' into multi-server-completions-tailwind 2023-08-30 22:58:37 -04:00
Antonio Scandurra ea17d1638e Introduce code generation (#2901)
![CleanShot 2023-08-28 at 12 24
36@2x](https://github.com/zed-industries/zed/assets/482957/f97cb399-1ac2-4fa9-94a7-137d1eec711c)


Release Notes:

- Added a new "Inline Assist" feature that lets you transform a
selection or generate new code at the cursor location by hitting
`ctrl-enter`.
2023-08-30 14:58:22 +02:00
Kirill BulatovandMax 100870aa9c Do not blink the cursor if Zed window is focused away
co-authored-by: Max <max@zed.dev>
2023-08-29 21:33:03 +03:00
Conrad Irwin dd577074f2 vim: Fix relative motions (#2888)
This changes vim motions to be relative to fold lines, not display
lines, to match the behaviour of vim.

This is necessary for relative line numbers to make sense (as the most
important thing is you can do `3j` to get th e line that is numbered 3).


Release Notes:

- vim: Fix handling of motions when `soft_wrap` is enabled in zed. Like
in vim `j,k,up,down,$,^,0,home,end` will all now navigate in file
coordinates not display coordinates.
- vim: Add `g {j,k,up,down,$,^,0,home,end}` to navigate in display
coordinates.
- vim: Add `z o` and `z c` to open and close folds.
- vim: Add `z f` in visual mode to fold selection.

Note: this may be a jarring change if you're grown used to the current
behaviour of `j` and `k`. You can make the issue less acute by setting
`"soft_wrap":"none"` in your settings; or you can manually copy the
bindings for `g j` to the binding for `j` (etc.) in your keymap.json to
preserve the existing behaviour.
2023-08-29 11:19:37 -07:00
JuliaandAntonio Scandurra 15628af04b Style language server name in completion menu
Omit in buffers with one or zero running language servers with the
capability to provide completions

Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-08-29 11:21:02 -04:00
Max Brunsfeld 791f6cf9e7 Update some tests to reflect code action debouncing 2023-08-28 17:45:32 -07:00
Max Brunsfeld 89eab78cf7 Debounce document highlight and code actions requests 2023-08-28 15:48:55 -07:00
JuliaandKirill Bulatov ded6decb29 Initial unstyled language server short name in completions
Co-Authored-By: Kirill Bulatov <kirill@zed.dev>
2023-08-28 11:27:45 -04:00
Antonio Scandurra 8c4d2ccf80 Close inline assist when the associated transaction is undone 2023-08-28 14:23:42 +02:00
Antonio Scandurra 44f554f489 Merge remote-tracking branch 'origin/main' into ai-refactoring 2023-08-28 12:16:24 +02:00
Piotr Osiewicz 07b9c6c302 language: Make Buffer::new take an explicit ID (#2900)
See Linear description for the full explanation of the issue. This PR is
mostly a mechanical change, except for the one case where we do pass in
an explicit `next_id` instead of `model_id` in project.rs.

Release Notes:
- Fixed a bug where some results were not reported in project search in
presence of unnamed buffers.
2023-08-28 11:51:50 +02:00
Kirill Bulatov 5cf51211b6 Use better names, simplify 2023-08-27 00:01:31 +03:00
Kirill Bulatov f8a8b998ce Properly react on excerpts drop 2023-08-26 15:21:45 +03:00
Kirill Bulatov 48659d3b3c Treat multibuffer edit events properly
Miltibuffer emits edit events even if it only got an excerpt
added/removed/etc.
Separate buffer edits and trigger hint invalidation refresh for them
only, also trigger hint new lines refresh on excerpt addition events.
2023-08-26 14:13:24 +03:00
Kirill Bulatov 3fc48fc277 Log LSP inlay hint path 2023-08-26 13:46:55 +03:00
Antonio Scandurra 55bf45d265 Add disabled style for prompt editor after confirming 2023-08-26 12:07:03 +02:00
Antonio Scandurra 658d616b96 Allow multiple inline assistant highlights at once 2023-08-26 11:55:47 +02:00
Kirill Bulatov 665d86ea73 Defer navigation target buffer opening 2023-08-26 02:45:08 +03:00
JuliaandMax Brunsfeld fc457d45f5 Add word_characters to language overrides & use for more things
Use word_characters to feed completion trigger characters as well and
also recognize kebab as a potential sub-word splitter. This is fine for
non-kebab-case languages because we'd only ever attempt to split a word
with a kebab in it in language scopes which are kebab-cased

Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-08-25 18:46:30 -04:00
Conrad Irwin 20aa2a4c54 vim: Fix relative line motion
Before this change up and down were in display co-ordinates, after this
change they are in fold coordinates (which matches the vim behaviour).

To make this work without causing usabliity problems, a bunch of extra
keyboard shortcuts now work:

- vim: `z {o,c}` to open,close a fold
- vim: `z f` to fold current visual selection
- vim: `g {j,k,up,down}` to move up/down a display line
- vim: `g {0,^,$,home,end}` to get to start/end of a display line

Fixes: zed-industries/community#1562
2023-08-25 14:40:04 -06:00
Max Brunsfeld 404f76739c Format let-else statements 2023-08-25 10:11:32 -07:00
Antonio Scandurra 27c90f12f6 Merge remote-tracking branch 'origin/main' into ai-refactoring 2023-08-25 13:37:32 +02: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 f8874a726c Attempt to highlight inlays 2023-08-25 14:26:17 +03:00