Commit Graph
143 Commits
Author SHA1 Message Date
Kirill Bulatov 1bfde4bfa2 Add more tests 2023-10-12 15:14:51 +03:00
Kirill Bulatov 7f4ebf50d3 Make the first prettier test pass 2023-10-12 13:30:49 +03:00
Kirill Bulatov e50f4c0ee5 Add prettier tests infrastructure 2023-10-11 19:13:28 +03:00
Conrad Irwin 2d99b327fc Don't wrap on paragraphs
For zed-industries/community#2116
2023-10-06 10:32:15 -06:00
Joseph T. Lyons 3cf7164a54 Fix text transformation commands for multiple line, single selection cases (#3060)
If you highlight the following block of text (with a single selection):

```
The quick brown
fox jumps over
the lazy dog
```

and run `editor: convert to upper camel case`, you'll get:

```
TheQuickBrown
foxJumpsOver
theLazyDog
```

instead of:

```
TheQuickBrown
FoxJumpsOver
TheLazyDog
```

The same thing happens for `editor: convert to title case`. This happens
because [`to_case` crate](https://crates.io/crates/convert_case) doesn't
allow the user to define '\n' as a boundary. I wanted to fix this at the
lib level, so I filled [an
issue](https://github.com/rutrum/convert-case/issues/16) but I never
heard back. What's strange is VS Code and Sublime I think both exhibit
the same output as we do currently, but I don't personally think this
feels right (happy to hear opposing opinions). I'm just doing the naive
thing to hack around this limitation of the `to_case` crate.

I did some testing and it seems I only need to adjust `editor: convert
to title case` and `editor: convert to upper camel case`. The way the
other transformations are implemented in `to_case` don't seem to have
this issue.

Release Notes:

- Fixed a bug where running certain text transfomration commands on a
single selection covering multiple lines would not transform all
selected lines as expected.
2023-09-28 14:04:17 -04:00
Conrad Irwin 8e1bbf32be vim: Fix ctrl-u/ctrl-d
They should work by exactly half a screen, and also move the cursor.
2023-09-26 22:28:04 -06: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
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
Kirill Bulatov 5bc5831032 Fix wrong assertion in the test 2023-08-31 14:31:43 +03:00
Kirill Bulatov fff385a585 Fix project tests 2023-08-31 13:01:53 +03:00
Julia ff3865a4ad Merge branch 'main' into multi-server-completions-tailwind 2023-08-30 22:58:37 -04: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
Max BrunsfeldandNathan a3b2c03b17 Fix bugs in autoscroll with 'fit' strategy
* Scroll to the newest cursor if all cursors can't fit in the viewport.
* Refuse to layout an editor less tall than one line height.

Co-authored-by: Nathan <nathan@zed.dev>
2023-08-25 16:13:12 -07: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
Mikaylaandmax 199be8241c Add following into channel notes
co-authored-by: max <max@zed.dev>
2023-08-24 11:25:20 -07:00
Kirill BulatovandJulia Risley 269dad5a9c Respect completion resolve server capabilities
Only query for additional edits if the server supports it

Co-Authored-By: Julia Risley <julia@zed.dev>
2023-08-18 16:55:47 +03:00
Nathan Sobo f0da6b05fd Remove TestAppContext::add_view
Instead, we now call this on window handles.
2023-08-07 22:46:48 -06:00
Nathan Sobo d687c3d81f Merge remote-tracking branch 'origin/main' into window-handles 2023-08-07 22:07:20 -06:00
Nathan Sobo f2be3181a9 Move window-related methods from TestAppContext to AnyWindowHandle 2023-08-07 20:23:04 -06:00
Nathan Sobo 486f5bc6ca Get compiling 2023-08-07 19:08:58 -06:00
Nathan Sobo adc50469ff WIP 2023-08-06 12:45:31 -06:00
Joseph T. Lyons 1abb6a0176 Expand empty selections to cover full word and fix bugs 2023-08-05 11:31:21 -04:00
Joseph T. LyonsandJulia 8c98b02e45 Add convert to {upper,lower} case commands
Co-Authored-By: Julia <30666851+ForLoveOfCats@users.noreply.github.com>
2023-08-04 15:10:33 -04:00
Nathan Sobo 485c0a482e Don't refcount window handles 2023-08-03 17:11:47 -06:00
Nathan Sobo afcc0d621b WIP 2023-08-03 17:03:39 -06:00
Nathan Sobo 884cee6dfd Get tests compiling returning WindowHandle<V: View> from add_window 2023-08-02 14:05:03 -06:00
Joseph T. Lyons 4085df5146 Add tests for manipulate_lines() 2023-07-25 15:17:16 -04:00
Joseph T. LyonsandMikayla Maki 93ec73da29 Fix code computing new selections
Co-Authored-By: Mikayla Maki <mikayla.c.maki@gmail.com>
2023-07-25 14:04:25 -04:00
Joseph T. Lyons 1a84382881 WIP 2023-07-25 10:33:20 -04:00
Max Brunsfeld 2f2ef7c165 Use workspace dependencies for tree-sitter grammars 2023-07-14 09:25:51 -07:00
Kirill BulatovandMax Brunsfeld 0c7949bdee Force resolve all completions, to ensure their edits are up-to-date
co-authored-by: Max Brunsfeld <max@zed.dev>
2023-07-12 21:10:01 +03:00
Kirill Bulatov c732aa1617 Do not resolve completions if extra edits are available 2023-07-12 20:28:16 +03:00
Kirill Bulatov 6d96c6ef51 Draft the postfix completions support 2023-07-12 18:32:03 +03:00
Kirill Bulatov 748e7af5a2 Add a test 2023-07-11 17:10:34 +03:00
Kirill BulatovandJulia Risley 85701c9b80 Do not perform OnTypeFormating after pair brace insert
Co-Authored-By: Julia Risley <julia@zed.dev>
2023-07-03 17:21:44 +03:00
Conrad Irwin 02fc5dd6c9 vim: Fix scrolling
After #2641 we noticed that scrolling didn't take a count parameter.

The PageDown/PageUp logic was also broken by an additional -1 (for both
vim mode and not).
2023-06-26 13:29:14 -06:00
Conrad Irwin 91bd8e305e join_lines: Skip over leading indentation 2023-06-21 13:44:31 -06:00
Nathan SoboandConrad Irwin cf38264eda Handle multiple selections when joining lines
Co-Authored-By: Conrad Irwin <conrad.irwin@gmail.com>
2023-06-21 11:47:06 -06:00
Nathan SoboandConrad Irwin 61352f68ea Add more assertions for joining lines at the end of the file
Co-Authored-By: Conrad Irwin <conrad.irwin@gmail.com>
2023-06-21 11:21:09 -06:00
Nathan SoboandConrad Irwin f07a929350 Allow joining multiple lines and deleting empty lines
Co-Authored-By: Conrad Irwin <conrad.irwin@gmail.com>
2023-06-21 11:18:28 -06:00
Nathan SoboandConrad Irwin c48bd394c1 Start on joining lines
Co-Authored-By: Conrad Irwin <conrad.irwin@gmail.com>
2023-06-21 10:32:02 -06:00
Antonio Scandurra 1aa1774688 Avoid auto-scrolling the editor when inserting/removing headers 2023-06-14 10:49:23 +02:00
Kevin Hovsäter b365e48ff0 Toggle comments for empty single line selections (#2594) 2023-06-13 20:15:11 +02:00
Piotr Osiewicz b272db9e21 editor: Add language setting for comment continuations (#2605)
Per @JosephTLyons request I've added a language setting for comment
continuations.

Release Notes:

- Added a language setting for comment continuations.
2023-06-13 18:59:46 +02:00
Piotr Osiewicz 5bef2f1778 Z-2303 editor: fix comment extension on the start of line (#2595)
Release Notes:

- Improved comment extension for cases where cursor was placed before
start of comment marker
2023-06-09 20:02:51 +02:00
Kevin Hovsäter 6ce3f3bf27 Refactor toggle comment tests 2023-06-09 13:22:04 +02:00
Kevin Hovsäter a8d43c6d71 Toggle comments for empty single line selections 2023-06-09 10:10:49 +02:00
Piotr Osiewicz e94129446d Z 1618/extend comments (#2585)
Fixes Z-1618. In the current state, this only works for line comments
such as `//` (and whatever's set in `{language}.toml` as a
line_comment).

Release Notes:

- Comments are now extended on new line.
2023-06-07 17:37:02 +02:00
Antonio Scandurra d26cc2c897 Maintain scroll bottom when streaming assistant responses 2023-06-07 15:01:50 +02:00