Commit Graph
2076 Commits
Author SHA1 Message Date
Kirill Bulatov de1ca60a54 Improve inlay hint cache lookup 2023-09-14 23:31:50 +03:00
Kirill Bulatov 17b09eb060 Restructure inlay highlights data for proper access 2023-09-14 23:05:22 +03:00
Kirill Bulatov 8702be1933 Remove useless background highlights code 2023-09-14 22:18:30 +03:00
Kirill Bulatov 0c70840290 Uncomment the rest of the tests 2023-09-14 22:18:26 +03:00
Kirill Bulatov 130e873079 Randomize inlay highlight range start 2023-09-14 22:08:12 +03:00
Kirill Bulatov a2dba081dc Consider offsets in inlay chunks 2023-09-14 22:08:12 +03:00
Kirill BulatovandAntonio Scandurra 15942c31ef 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 58a24cf6d8 Add inlay highlight test 2023-09-14 22:08:12 +03:00
Kirill Bulatov 95bfe39bf9 Implement inlay highlighting 2023-09-14 22:08:12 +03:00
Kirill Bulatov d2b0649378 Use standalone inlay background highlights 2023-09-14 22:08:12 +03:00
Kirill Bulatov c8ede63d7c Unify highlights in *Map 2023-09-14 22:08:12 +03:00
Kirill Bulatov 5a9d375f79 Do not combine inlay and text highlights on the *Map level 2023-09-14 22:08:12 +03:00
Piotr Osiewicz 46f38f13ed 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 5893c05c1b Merge remote-tracking branch 'origin/main' into polish-codegen 2023-09-13 11:41:32 +02:00
Piotr Osiewicz c4e0bcb99e Z 1200/replace in buffer (#2922)
This is still WIP, mostly pending styling. I added a pretty rudimentary
text field and no buttons whatsoever other than that. I am targeting a
Preview of 09.13, as I am gonna be on PTO for the next week.

I dislike the current implementation slightly because of `regex`'s crate
syntax and lack of support of backreferences. What strikes me as odd wrt
to syntax is that it will just replace a capture name with empty string
if that capture is missing from the regex. While this is perfectly fine
behaviour for conditionally-matched capture groups (e.g. `(foo)?`), I
think it should still error out if there's no group with a given name
(conditional or not).
Release Notes:

- Added "Replace" functionality to buffer search.
2023-09-12 18:46:54 +02:00
Nathan Sobo b2968c2d11 Eliminate PaintContext 2023-09-11 09:00:59 -06:00
Nathan Sobo 950ac4fbc6 Eliminate LayoutContext 2023-09-11 08:47:00 -06:00
Antonio Scandurra 43408f4f8e Extract code generation logic into its own module 2023-09-11 11:25:37 +02:00
Nathan Sobo 20da2b4621 Checkpoint 2023-09-08 16:25:10 -06:00
Nathan Sobo 3221dc9e05 Merge branch 'main' into storybook 2023-09-08 14:18:44 -06:00
Nathan Sobo a1cc229417 Move refreshing to window 2023-09-08 13:27:29 -06:00
Conrad Irwin cec47cb01a vim . to replay (#2936)
Release Notes:

- vim: Add `.` to replay
([#946](https://github.com/zed-industries/community/issues/946))
- vim: Fix `J` in visual mode, and with counts.
2023-09-08 11:52:35 -06:00
Conrad Irwin 298d072b93 Fix f,t on soft-wrapped lines
Also remove the (dangerously confusing) display_map.find_while
2023-09-08 10:16:46 -06:00
Conrad Irwin 17c2ee6ed1 Add visual area repeating 2023-09-07 10:45:38 -06:00
Nathan Sobo 563e18712c Merge branch 'main' into storybook 2023-09-07 07:56:57 -06:00
Nathan Sobo 4f7a2ff0ac Checkpoint 2023-09-06 14:16:15 -06:00
Conrad Irwinand 204e716a5d vim . to replay
Co-Authored-By: maxbrunsfeld@gmail.com
2023-09-06 13:49:55 -06:00
Conrad Irwin ea19a9e284 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 c240a03a92 Merge branch 'main' into vim-softwrap-word 2023-09-01 12:23:56 -06:00
Conrad Irwin 6117aac1d1 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
Nathan Sobo fad5e69b3c Merge remote-tracking branch 'origin' into storybook 2023-09-01 10:08:48 -06:00
Kirill Bulatov 984505c584 Fix wrong assertion in the test 2023-08-31 14:31:43 +03:00
Kirill Bulatov f5e0c28971 Fix project tests 2023-08-31 13:01:53 +03:00
Julia 3faabbe91a Merge branch 'main' into multi-server-completions-tailwind 2023-08-30 22:58:37 -04:00
Max BrunsfeldandMikayla 820cb00d62 Fix cursor colors of non-followed collaborators
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-30 14:14:18 -07:00
Antonio Scandurra 8f85b1a536 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
Nathan Sobo 369e542607 Move views_to_notify_if_ancestors_change to Window 2023-08-29 21:58:44 -06:00
Nathan Sobo 07a33439b7 Store new_parents on Window instead of layout context 2023-08-29 21:43:48 -06:00
Conrad Irwin d614796305 Fix find_{,preceding}boundary to work on buffer text
Before this change the bounday could mistakenly have happened on a soft
line wrap.

Also fixes interaction with inlays better.
2023-08-29 18:03:29 -07:00
Kirill BulatovandMax 54fc1eeed6 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 a30017333b 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 ce0038a8ab 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 d8df0315ad Update some tests to reflect code action debouncing 2023-08-28 17:45:32 -07:00
Max Brunsfeld 9e19be9731 Debounce document highlight and code actions requests 2023-08-28 15:48:55 -07:00
JuliaandKirill Bulatov f197a59d69 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 40c8e5b9ef Allow redoing edits performed by inline assistant after cancelling it 2023-08-28 14:42:52 +02:00
Antonio Scandurra f1f1a5f367 Close inline assist when the associated transaction is undone 2023-08-28 14:23:42 +02:00
Antonio Scandurra bafdbdc38c Merge remote-tracking branch 'origin/main' into ai-refactoring 2023-08-28 12:16:24 +02:00
Piotr Osiewicz 0818c0d178 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 fd8f077f1e Fix the tests 2023-08-27 19:41:15 +03:00