Commit Graph
5172 Commits
Author SHA1 Message Date
Piotr Osiewicz 563d506da1 copilot: Propagate action if suggest_next is not possible. (#3129)
One of our users ran into an issue where typing "true quote" characters
(option-[ for „ and option-] for ‚) was not possible; I've narrowed it
down to a collision with Copilot's NextSuggestion and PreviousSuggestion
action default keybinds. I explicitly did not want to alter the key
bindings, so I've went with a more neutral fix - one that propagates the
keystroke if there's no Copilot action to be taken (user is not using
Copilot etc). Note however that typing true quotes while using a Copilot
is still not possible, as for that we'd have to change a keybind.

Fixes zed-industries/community#2072


Release Notes:
- Fixed Copilot's "Suggest next" and "Suggest previous" actions
colliding with true quotes key bindings (`option-[` and `option-]`). The
keystrokes are now propagated if there's no Copilot action to be taken
at cursor's position.
2023-10-15 17:27:36 +02:00
Julia e3e012b4b4 Autocomplete docs (#3126)
Release Notes:

- Added documentation display for autocomplete items.
- Fixed autocomplete filtering blocking the Zed UI, causing hitches and
input delays with large completion lists.
- Fixed hover popup link not firing if the mouse moved a slight amount
while clicking.
- Added support for absolute path file links in hover popup and
autocomplete docs.
2023-10-13 13:26:45 -04:00
Julia 8985fca6a9 Add setting to disable completion docs 2023-10-12 22:08:47 -04:00
Julia cbb05fe9a8 Whooooops 2023-10-12 21:00:31 -04:00
Julia bcfc3a8d6a Eagerly attempt to resolve missing completion documentation 2023-10-12 19:28:17 -04:00
Julia 4c0091df7a Unbork markdown parse test by making links match 2023-10-12 16:18:54 -04:00
Julia 1dd6e3c0d0 Race completion filter w/completion request & make not block UI 2023-10-12 13:23:26 -04:00
Julia 1a27bf9ae1 Allow file links in markdown & filter links a bit aggressively 2023-10-12 12:11:27 -04:00
Kirill Bulatov 222bb37da6 Add more tests 2023-10-12 15:14:51 +03:00
Kirill Bulatov 7c90ad59a6 Make the first prettier test pass 2023-10-12 13:30:49 +03:00
Julia 28dadd1002 Fire markdown link on mouse down
Previously any amount of mouse movement would disqualify the mouse down
and up from being a click, being a drag instead, which is a long
standing UX issue. We can get away with just firing on mouse down here
for now
2023-10-11 14:39:34 -04:00
Julia 09cbfcb608 Fixup layout 2023-10-11 13:41:58 -04:00
Kirill Bulatov 61f321016d Add prettier tests infrastructure 2023-10-11 19:13:28 +03:00
JuliaandAntonio Scandurra 545bfa4231 Make completion documentation scroll & fix accompanying panic from tag
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-10-10 10:08:29 -04:00
JuliaandAntonio Scandurra 378ea7f7e1 Avoid leaving selected item index past end of matches list
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2023-10-10 09:27:18 -04:00
Julia 24233511f1 Enable completion menu to resolve documentation when guest 2023-10-10 00:16:15 -04:00
Conrad Irwin ccc2c5fdd6 Use Horizontal ranges everywhere 2023-10-09 21:48:50 -06:00
Conrad Irwin 3e26012885 Round better for up/down 2023-10-09 21:48:32 -06:00
Conrad Irwin a1ae399638 Get the project running! 2023-10-09 21:48:31 -06:00
Conrad Irwin 21e620fbd0 Refactor to pass a TextLayoutDetails around 2023-10-09 21:47:58 -06:00
Conrad IrwinandJulia 9ad2240680 Begin to use pixels for column selection
For zed-industries/community#759
For zed-industries/community#1966

Co-Authored-By: Julia <floc@unpromptedtirade.com>
2023-10-09 21:47:58 -06:00
Julia a45b0c2e23 Fix hover_popover.rs after bad rebase 2023-10-09 14:28:53 -04:00
Julia dbd0eb6288 If documentation included in original completion then parse up front 2023-10-06 13:26:39 -04:00
Julia 71d90aa792 Unbork info popover parsing/rendering and make better 2023-10-06 13:26:39 -04:00
Julia 02523c3e1c Don't need editor style to parse markdown 2023-10-06 13:26:39 -04:00
Julia 96eb6b7dce Wait for language to load when parsing markdown 2023-10-06 13:26:39 -04:00
Julia 7c3b57c643 If documentation exists and hasn't been parsed, do so at render and keep 2023-10-06 13:26:38 -04:00
Julia ee129e022f Preparse documentation markdown when resolving completion 2023-10-06 13:26:38 -04:00
Julia 7e915279f6 Asynchronously request completion documentation if not present 2023-10-06 13:26:38 -04:00
Julia 8f1f17e3de Most of getting completion documentation resolved & cached MD parsing 2023-10-06 13:26:38 -04:00
Julia 45c9640166 Make completion docs scrollable 2023-10-06 13:26:38 -04:00
Julia e2460385e6 Merge info popover's and autocomplete docs' markdown rendering 2023-10-06 13:26:38 -04:00
Julia 33cd059f05 Add markdown rendering to alongside completion docs 2023-10-06 13:26:38 -04:00
Julia 8accb97a89 Actually display the correct completion's doc 2023-10-06 13:26:38 -04:00
Julia 326a103d4e Start hacking in autocomplete docs 2023-10-06 13:26:38 -04:00
Conrad Irwin 03d8021662 Don't wrap on paragraphs
For zed-industries/community#2116
2023-10-06 10:32:15 -06:00
Mikayla Maki 0bb0e601bd Add markdown parsing to channel chat (#3088)
TODO:
- [x] Add markdown rendering to channel chat
- [x] Unify (?) rendering logic between hover popover and chat
- [x] ~~Determine how to deal with document-oriented markdown like `#`~~
Unimportant until we want to do something special with `#channel`
- [x] Tidy up spacing and styles in chat panel

Release Notes:

- Added markdown rendering to channel chat
- Improved channel chat message style
- Fixed a bug where long chat messages would not soft wrap
2023-10-05 14:30:12 -07:00
Mikayla aa11e374c3 re-unify markdown parsing between hover_popover and chat 2023-10-05 14:22:41 -07:00
Conrad Irwin f1dc4708ff Clear SelectionGoal on input 2023-10-05 09:02:52 -06:00
Julia 83f32c91a3 Detach completion confirmation task when selecting with mouse
Otherwise the spawn to resolve the additional edits never runs causing
autocomplete to never add imports automatically when clicking with the
mouse
2023-10-02 13:18:49 -04:00
Max Brunsfeld 0729b740c9 Merge branch 'main' into allow-following-outside-of-projects 2023-09-28 11:58:28 -07:00
Max BrunsfeldandConrad 8b2a8959d3 Fix coloring of local selections when following
Co-authored-by: Conrad <conrad@zed.dev>
2023-09-28 11:37:47 -07:00
Max BrunsfeldandConrad 13f4957210 Rename color_index to participant_index
Co-authored-by: Conrad <conrad@zed.dev>
2023-09-28 11:37:22 -07:00
0976bdc78d Assign unique color indices to room participants, use those instead of replica_ids
Co-authored-by: Conrad <conrad@zed.dev>
Co-authored-by: Antonio <antonio@zed.dev>
2023-09-28 11:06:09 -07:00
Joseph T. Lyons 50d9dc65aa 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 e9ad47aa8e vim: Fix ctrl-u/ctrl-d (#3044)
- vim: Fix ctrl-d/ctrl-u to match vim (when :set scrolloff=3)
2023-09-27 07:48:50 -06:00
Conrad Irwin 6fd4a8fcba 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
Kirill Bulatov e2f915e53c Hide inlay hints toggle if they are not supported by the current editor 2023-09-26 23:52:11 +02:00
Piotr Osiewicz bac74f0c02 editor: Start transaction in replace impl (#3036)
This fixes the undo with replace in project
/cc @maxbrunsfeld 

Release Notes:

- N/A
2023-09-26 19:21:15 +02:00
Conrad Irwin 2061d7e47a vim: Command (#2951)
Release Notes:

- vim: Add v1 of command mode
([#279](https://github.com/zed-industries/community/issues/279)). The
goal was to cover 90% of what most people actually do, but it is very
incomplete. Known omissions are that ranges cannot be specified (except
that `:%s//` must always specify the % range), commands cannot take
arguments (you can `:w` but not `:w [file]`), and there is no history.
Please file feature requests on
https://github.com/zed-industries/community as you notice things that
could be better.
- `:` triggers zed's command palette. If you type a known vim command it
will run it, otherwise you get zed's normal fuzzy search. For this
release supported commands are limited to:
- - `:w[rite][!]`, `:wq[!]`, `:q[uit][!]`, `:wa[ll][!]`, `:wqa[ll][!]`,
`:qa[ll][!]`, `:[e]x[it][!]`, `:up[date]` to save/close tab(s) and
pane(s).
- - `:cq` to quit completely.
- - `:vs[plit]`, `:sp[lit]` to split vertically/horizontally
- - `:new`, `:vne[w]` to create a new file in a new pane above or to the
left
- - `:tabedit`, `:tabnew` to create a new file in a new tab.
- - `:tabn[ext]`, `:tabp[rev]` to go to previous/next tabs
- - `:tabc[lose]` to close tabs
- - `:cn[ext]`, `:cp[rev]`, `:ln[ext]`, `:lp[rev]` to go to the
next/prev diagnostics.
- - `:cc`, `:ll` to open the errors page
- - `:<number>` to jump to a line number.
- - `:$` to jump to end of file
- - `:%s/foo/bar/` (note that /g is always implied, the range must
always be %, and zed uses different regex syntax to vim)
- - `:/foo` and `:?foo` to jump to next/prev line matching foo
- - `:j[oin]`, to join the current line (no range is yet supported)
- - `:d[elete][l][p]`, to delete the current line (no range is yet
supported)
- - `:s[ort] [i]` to sort the current selection (case-insensitively)
- vim: Add `ctrl-w o` (closes everything except the current item) and
`ctrl-w n` (creates a new file in the pane above).
([#1884](https://github.com/zed-industries/community/issues/1884))
- all: Add a "Discard" option to prompt when saving a file with
conflicts (previously this only appeared on close, not on save).

Internal changes:
- The Picker will now wait for pending queries before confirming (to
handle people typing `: w enter` rapidly.
- workspace::save_item and Pane::save_item are now merged together, and
the behavior controlled by `workspace::SaveIntent`.
- Many actions related to closing/saving items now take an optional
`SaveIntent`.
-
2023-09-25 14:07:22 -05:00