Commit Graph

2400 Commits

Author SHA1 Message Date
Julia
5b1894a9b1
Take into account multiple scroll deltas within a single frame (#3982)
Release Notes:

- Fixed an issue where all but the last scroll event would be dropped if
there were multiple within a single frame.
2024-01-09 14:51:26 -05:00
Julia
463270ed36 Take into account multiple scroll deltas within a single frame
Co-Authored-By: Antonio Scandurra <antonio@zed.dev>
2024-01-09 14:32:43 -05:00
Nathan Sobo
42cbd103fb Even more docs
Co-authored-by: Conrad <conrad@zed.dev>
2024-01-09 12:02:12 -07:00
Marshall Bowers
824d06e2b2
Remove Default impl for StatusColors (#3977)
This PR removes the `Default` impl for `StatusColors`.

Since we need default light and dark variants for `StatusColors`, we
can't use a single `Default` impl.

Release Notes:

- N/A
2024-01-09 11:31:19 -05:00
Marshall Bowers
fa53353c57
Rename IconElement to just Icon (#3974)
This PR renames the `IconElement` component to just `Icon`.

This better matches the rest of our components, as `IconElement` was the
only one using this naming convention.

The `Icon` enum has been renamed to `IconName` to free up the name.

I was trying to come up with a way that would allow rendering an
`Icon::Zed` directly (and thus make the `IconElement` a hidden part of
the API), but I couldn't come up with a way to do this cleanly.

Release Notes:

- N/A
2024-01-09 10:11:20 -05:00
Kirill Bulatov
625c9d8980 Remove some todo!'s 2024-01-09 11:36:36 +02:00
Piotr Osiewicz
e4b1c76895
Display setting documentation in settings.json (#3936)
Let this screenshot of settings.json speak for itself: 

![image](https://github.com/zed-industries/zed/assets/24362066/fca60383-1788-43f9-803b-00f083394c8a)

Release Notes:
- Added code completion & on-hover documentation to Zed's settings.json
file.

---------

Co-authored-by: Marshall Bowers <elliott.codes@gmail.com>
2024-01-08 19:30:18 +01:00
Marshall Bowers
a8c193c7a6
Remove resolved TODO (#3943)
This PR removes a resolved TODO in drawing diff hunk status.

Release Notes:

- N/A
2024-01-08 13:08:44 -05:00
Marshall Bowers
46a99feb97
Use correct color for folded diff indicator (#3942)
This PR updates the indicator for changes within a fold to use the
correct color from the theme:

<img width="380" alt="Screenshot 2024-01-08 at 12 52 56 PM"
src="https://github.com/zed-industries/zed/assets/1486634/b8bf6bf3-6acc-43a4-8c4b-a02c975c7f02">

Release Notes:

- Updated the color of the indicator for a fold containing modified
lines.
2024-01-08 12:58:04 -05:00
Piotr Osiewicz
d475f1373a
gpui: Further docs refinement & moved some reexports into 'private' module (#3935)
This commit mostly fixes invalid URLs in docstrings. It also
encapsulates crates we reexport (serde stuff + linkme) into a public
module named "private" in order to reduce the API surfaced through docs.
Moreover, I fixed up a bunch of crates that were pulling serde_json in
through gpui explicitly instead of using Cargo manifest.

Release Notes:
- N/A
2024-01-07 14:14:21 +01:00
Joseph T. Lyons
ea1770254d Merge branch 'main' into instrument-welcome-screen 2024-01-06 15:23:06 -05:00
Joseph T. Lyons
167a0b590f Add event for welcome page close 2024-01-06 15:17:28 -05:00
Joseph T. Lyons
cdd5cb16ed WIP 2024-01-06 14:41:35 -05:00
Antonio Scandurra
23414d185c Fix bug that was causing Editor to notify on every mouse move 2024-01-06 18:56:55 +01:00
Conrad Irwin
709682e8bc Tidy up TestContext lifecycle
Co-Authored-By: Max <max@zed.dev>
2024-01-05 16:31:41 -07:00
Marshall Bowers
79cccdb6d1
Use regular text color for diagnostic popovers (#3918)
This PR updates the diagnostic popovers to use the regular editor text
color rather than one specific to the diagnostic kind.

Release Notes:

- Updated text color in diagnostic popovers.
2024-01-05 14:13:43 -05:00
Conrad Irwin
3c0052850c Merge branch 'main' into channel-guests 2024-01-05 10:05:59 -07:00
Conrad Irwin
df0076a4eb
Better TestWindow support (#3876)
Adding guest roles led us down a rabbit hole where we'd have liked to
rely on a
side-effect of activating a window in tests; but the test window didn't
implement that.

Looking into that, I realized our TestWindow wasn't doing a great job of
emulating the MacWindow, so this makes the two more similar.
2024-01-05 09:59:48 -07:00
Kirill Bulatov
3070a6ef26 Return back git status colors for tab labels 2024-01-05 12:38:42 +02:00
Conrad Irwin
fff415e3e9 Improve deactivate simulation 2024-01-04 22:06:52 -07:00
Marshall Bowers
e4aa7ba4f2
Try to load fallback fonts instead of panicking when a font is not found (#3891)
This PR adjusts our font resolution code to attempt to use a fallback
font if the specified font cannot be found.

Right now our fallback font stack is `Zed Mono`, followed by `Helvetica`
(in practice we should always be able to resolve `Zed Mono` since we
bundle it with the app).

In the future we'll want to surface the ability to set the fallback font
stack from GPUI consumers, and potentially even support specifying font
stacks in the user settings (as opposed to a single font family).

Release Notes:

- Fixed a panic when trying to load a font that could not be found.
2024-01-04 14:10:46 -05:00
Antonio Scandurra
6f4a08ba5a Prevent scrolling editor and resizing panels at the same time
This fixes a bug that would cause Zed to never stop resizing
panels when the drag handle overlapped with an editor scrollbar.

Co-Authored-By: Marshall <marshall@zed.dev>
2024-01-04 17:25:02 +01:00
Antonio Scandurra
f0afa3f9e3 Show scrollbar even when buffer search highlights are outside viewport 2024-01-04 12:39:15 +01:00
Joseph T. Lyons
2972ee8ced Move telemetry settings check into telemetry module 2024-01-04 01:13:21 -05:00
Marshall Bowers
e903adf016
Use dense spacing for completion menu items (#3874)
This PR updates the completion menu to use dense spacing for its items.

Release Notes:

- Adjusted styling of completion menu entries.
2024-01-03 23:06:16 -05:00
Conrad Irwin
6877bd4969 Make read only buffers feel more read only 2024-01-03 19:31:43 -07:00
Conrad Irwin
84171787a5 Track read_only per project and buffer
This uses a new enum to avoid confusing booleans
2024-01-03 19:31:43 -07:00
Max Brunsfeld
f5ba22659b Remove 2 suffix from gpui
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:59:39 -08:00
Max Brunsfeld
dfcb17fe74 Remove 2 suffix for theme
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:41:01 -08:00
Max Brunsfeld
4305c5fdbe Remove 2 suffix for ui, storybook, text
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:33:51 -08:00
Max Brunsfeld
0cf65223ce Remove 2 suffix for collab, rope, settings, menu
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:29:16 -08:00
Max Brunsfeld
177e3028a9 Remove 3 suffix for git crate
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:11:59 -08:00
Max Brunsfeld
5ddd298b4d Remove 2 suffix for fs, db, semantic_index, prettier
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:09:42 -08:00
Max Brunsfeld
53bdf6beb3 Remove 2 suffix for client, call, channel
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 12:02:14 -08:00
Max Brunsfeld
9f99e58834 Remove 2 suffix for lsp, language, fuzzy
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 11:58:02 -08:00
Max Brunsfeld
c5a1950522 Remove 2 suffix for project
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 11:53:34 -08:00
Max Brunsfeld
4ddb26204f Remove 2 suffix for ai, zed_actions, install_ci, feature_flags
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 11:48:46 -08:00
Max Brunsfeld
789ce8dd75 Remove 2 suffix for workspace
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 11:08:51 -08:00
Max Brunsfeld
492805af9c Remove 2 suffix for multi_buffer, outline, copilot
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 11:01:58 -08:00
Max Brunsfeld
588976d27a Remove 2 suffix for editor
Co-authored-by: Mikayla <mikayla@zed.dev>
2024-01-03 10:58:57 -08:00
Kirill Bulatov
55374e8ac0 Port to gpui1 2023-12-11 12:28:22 +02:00
Kirill Bulatov
df7b89b6cb
Allow to include gitignored files into project search (#3394) 2023-11-23 19:28:11 +02:00
Kirill Bulatov
eee63835fb Exclude more ignored/worktree-less/project-less buffers from inlay hint requests 2023-11-23 10:30:52 +02:00
Julia
f0c7b3e6ee Update copilot when we are the last task 2023-11-22 14:03:43 -05:00
Julia
9abce4bdd9 zed1: Cancel completion resolution when new list
Co-Authored-By: Max Brunsfeld <max@zed.dev>
2023-11-22 13:16:52 -05:00
Joseph T. Lyons
3abd376d6a Add timestamp delta to telemetry events 2023-11-19 21:52:28 -05:00
Max Brunsfeld
b6eef26f91 Merge branch 'main' into search-query-suggestion-fixes 2023-11-09 14:18:17 -08:00
Max Brunsfeld
6b8ce3cc85 Add a setting for when to seed the search query from the text under the cursor 2023-11-09 14:03:14 -08:00
Max Brunsfeld
dba41e99dd Avoid suggesting search query if cursor is not on a word 2023-11-09 12:33:30 -08:00
Kirill Bulatov
6f8947a3d3 Fix a compilation error 2023-11-03 21:51:12 +02:00
Kirill Bulatov
9cb8ce172d Refresh diagnostics inside the tab 2023-11-03 21:51:12 +02:00
Max Brunsfeld
d6abd8a2b4 Add missing dev-dependency feature for editor multi_buffer dependency 2023-10-30 15:32:52 -07:00
Joseph T. Lyons
dd89b2e6d4 Pull duplicate call out of if-else block 2023-10-29 13:54:32 -05:00
Joseph T. Lyons
34747bbbbc Do not call scroll_to twice 2023-10-29 13:47:02 -05:00
Piotr Osiewicz
7f6bb3d1eb
Extract multi_buffer module out of editor (#3170)
Release Notes:

- N/A
2023-10-25 19:31:47 +02:00
Julia
1936ba5e30
F8 navigation bugs (#3163)
Release Notes:

- Fixed "go to previous hunk" getting suck on deletion.
- Fixed a rare case where "go to (prev) diagnostic" could get stuck with
specifically overlapping diagnostics.
2023-10-25 19:03:45 +02:00
Joseph T. Lyons
1c5b321058 Allow completion menus to be cycled 2023-10-24 19:29:44 +02:00
Julia
bfdff4e2e0 When navigating diagnostics, skip diagnostic containing cursor
Slightly unfortunate but prevents an issue with weirdly overlapping
diagnostics causing the cursor to bounce between them
2023-10-24 17:56:56 +02:00
Kirill Bulatov
e9ce935991 Rework prettier tests
Do not infuse `FakeNodeRuntime` with prettier exceptions, rather keep
the default formatter installation method as no-op.
2023-10-24 14:25:46 +02:00
Julia
48cdefe6cf Re-understand that the line just below git deletion is "inside" hunk
Fixes "go to previous hunk" getting stuck on a deletion, never going
further up
2023-10-24 11:17:42 +02:00
Conrad Irwin
2b95db087b
Fix infinite loop in select all (#3154)
[[PR Description]]

Release Notes:

- Fixed an infinite loop in select all matches
([#2170](https://github.com/zed-industries/community/issues/2170)).
2023-10-24 02:58:48 -06:00
Conrad Irwin
0e035c1a95 Fix character selection 2023-10-24 10:50:08 +02:00
Conrad Irwin
6e4e19d8fc Fix infinite loop in select all 2023-10-23 16:08:12 +02:00
Conrad Irwin
9589f5573d Fix some bugs with vim objects
- softwrap interaction
- correct selection if cursor is on opening marker
2023-10-22 21:44:34 -06:00
Kirill Bulatov
26638748bb
Move prettier parsers data into languages from LSP adapters (#3150)
Release Notes:

- Fixed incorrect prettier parsers sometimes being applied to certain
files
2023-10-21 02:22:21 +03:00
Kirill Bulatov
7748848b6e Move prettier parsers data into languages from LSP adapters 2023-10-21 01:14:03 +02:00
Conrad Irwin
0dae0f6027
pixel columns (#3052)
@ForLoveOfCats and I found a few speedups that make this acceptably fast
(able to update ~10k selections in <100ms), so the remaining work here
is to fix the tests, and then ship!

Release notes:
- Updated up/down to work based on pixel positions
([#1966](https://github.com/zed-industries/community/issues/1966))
([#759](https://github.com/zed-industries/community/issues/759))
- vim: Fixed off-by-one in visual block mode
([2123](https://github.com/zed-industries/community/issues/2123))
2023-10-20 15:01:27 -06:00
Conrad Irwin
2de34a905d Hide any circumstantial evidence that this didn't work perfectly first
time
2023-10-20 14:45:37 -06:00
Conrad Irwin
fae5b1e391 Fix build columnar selection logic 2023-10-20 12:55:41 -06:00
Conrad Irwin
43d682f6b8 Handle pixel-down to last line when no trailing newline 2023-10-20 12:46:14 -06:00
Conrad Irwin
1c36134cf9 Fix single column vim selections 2023-10-20 11:17:19 -06:00
Conrad Irwin
b596b4153f Fix test 2023-10-20 10:34:09 -06:00
Kirill Bulatov
40104c06e2 Sort hint request ranges before asserting to avoid flackiness 2023-10-19 11:05:47 +03:00
Conrad Irwin
9d07561d99 Merge branch 'main' into pixel-columns 2023-10-18 23:00:56 -06:00
Conrad Irwin
3eb8aa8085 Refactor TextLayoutDetails construction 2023-10-18 22:56:11 -06:00
Conrad Irwin
cb76b2a6ad Make vim visual block work better 2023-10-18 22:23:06 -06:00
Max Brunsfeld
655c9ece2d Fix possibility of infinite loop in selections_with_autoclose_regions
Previously, that method could loop forever if the editor's autoclose
regions had unexpected selection ids.

Co-authored-by: Piotr <piotr@zed.dev>
2023-10-18 11:16:14 -07:00
Piotr Osiewicz
cc335db9e0
editor/language: hoist out non-generic parts of edit functions. (#3130)
This reduces LLVM IR size of editor (that's one of the heaviest crates
to build) by almost 5%.

LLVM IR size of `editor` before this PR: 3280386
LLVM IR size with `editor::edit` changed: 3227092
LLVM IR size with `editor::edit` and `language::edit` changed: 3146807

Release Notes:
- N/A
2023-10-16 13:17:44 +02:00
Piotr Osiewicz
6f4008ebab
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
2323fd17b0
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
ec4391b88e Add setting to disable completion docs 2023-10-12 22:08:47 -04:00
Julia
1c3ecc4ad2 Whooooops 2023-10-12 21:00:31 -04:00
Julia
c4fc9f7ed8 Eagerly attempt to resolve missing completion documentation 2023-10-12 19:28:17 -04:00
Julia
d23bb3b05d Unbork markdown parse test by making links match 2023-10-12 16:18:54 -04:00
Julia
85332eacbd Race completion filter w/completion request & make not block UI 2023-10-12 13:23:26 -04:00
Julia
4688a94a54 Allow file links in markdown & filter links a bit aggressively 2023-10-12 12:11:27 -04:00
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
Julia
a09ee3a41b 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
0cec0c1c1d Fixup layout 2023-10-11 13:41:58 -04:00
Kirill Bulatov
e50f4c0ee5 Add prettier tests infrastructure 2023-10-11 19:13:28 +03:00
Julia
801af95a13 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
Julia
f5af5f7334 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
354882f2c0 Enable completion menu to resolve documentation when guest 2023-10-10 00:16:15 -04:00
Conrad Irwin
ab050d1890 Use Horizontal ranges everywhere 2023-10-09 21:48:50 -06:00
Conrad Irwin
002e2cc42c Round better for up/down 2023-10-09 21:48:32 -06:00
Conrad Irwin
ef7e2c5d86 Get the project running! 2023-10-09 21:48:31 -06:00
Conrad Irwin
e7badb38e9 Refactor to pass a TextLayoutDetails around 2023-10-09 21:47:58 -06:00
Conrad Irwin
dacc8cb5f4 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
7020050b06 Fix hover_popover.rs after bad rebase 2023-10-09 14:28:53 -04:00
Julia
9d8cff1275 If documentation included in original completion then parse up front 2023-10-06 13:26:39 -04:00
Julia
32a29cd4d3 Unbork info popover parsing/rendering and make better 2023-10-06 13:26:39 -04:00
Julia
8dca4c3f9a Don't need editor style to parse markdown 2023-10-06 13:26:39 -04:00
Julia
a881b1f5fb Wait for language to load when parsing markdown 2023-10-06 13:26:39 -04:00
Julia
ea6f366d23 If documentation exists and hasn't been parsed, do so at render and keep 2023-10-06 13:26:38 -04:00
Julia
b8876f2b17 Preparse documentation markdown when resolving completion 2023-10-06 13:26:38 -04:00
Julia
fe62423344 Asynchronously request completion documentation if not present 2023-10-06 13:26:38 -04:00
Julia
77ba25328c Most of getting completion documentation resolved & cached MD parsing 2023-10-06 13:26:38 -04:00
Julia
ca88717f0c Make completion docs scrollable 2023-10-06 13:26:38 -04:00
Julia
e8be14e5d6 Merge info popover's and autocomplete docs' markdown rendering 2023-10-06 13:26:38 -04:00
Julia
370a3cafd0 Add markdown rendering to alongside completion docs 2023-10-06 13:26:38 -04:00
Julia
1584dae9c2 Actually display the correct completion's doc 2023-10-06 13:26:38 -04:00
Julia
e802c072f7 Start hacking in autocomplete docs 2023-10-06 13:26:38 -04:00
Conrad Irwin
2d99b327fc Don't wrap on paragraphs
For zed-industries/community#2116
2023-10-06 10:32:15 -06:00
Mikayla Maki
37de4a9990
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
c4870e1b6b
re-unify markdown parsing between hover_popover and chat 2023-10-05 14:22:41 -07:00
Conrad Irwin
f1c743286d Clear SelectionGoal on input 2023-10-05 09:02:52 -06:00
Julia
3d68fcad0b 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
a8b35eb8f5 Merge branch 'main' into allow-following-outside-of-projects 2023-09-28 11:58:28 -07:00
Max Brunsfeld
0c95e5a6ca Fix coloring of local selections when following
Co-authored-by: Conrad <conrad@zed.dev>
2023-09-28 11:37:47 -07:00
Max Brunsfeld
0f39b63801 Rename color_index to participant_index
Co-authored-by: Conrad <conrad@zed.dev>
2023-09-28 11:37:22 -07:00
Max Brunsfeld
545b5e0161 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
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
c63cc78ffd
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
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
Kirill Bulatov
7e2cef98a7 Hide inlay hints toggle if they are not supported by the current editor 2023-09-26 23:52:11 +02:00
Piotr Osiewicz
8c47f117db
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
d17d38fe70
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
Conrad Irwin
769c330b3d Merge branch 'vim-command' 2023-09-25 11:41:13 -06:00
Julia
80eaabd360 Activate correct item when clicking on a code action with the mouse 2023-09-25 13:31:00 -04:00
Julia
a278428bd5 Trigger scroll_to on code action list when moving selection 2023-09-25 11:13:50 -04:00
Kirill Bulatov
afa7045847 Tone down inlay hint update logs 2023-09-22 17:04:11 +03:00
Max Brunsfeld
4ffa167256 Allow following into channel notes regardless of project 2023-09-21 17:12:59 -07:00
Piotr Osiewicz
dbfa1d7263
[WIP] Replace in project (#2984)
Targeting Preview of 09.27.
This is still pending several touchups/clearups:
- We should watch multibuffer for changes and rescan the excerpts. This
should also update match count.
- Closing editor while multibuffer with 100's of changed files is open
leads to us prompting for save once per each file in the multibuffer.
One could in theory save in multibuffer before closing it (thus avoiding
unnecessary prompts), but it'd be cool to be able to "Save all"/"Discard
All".

Release Notes:

- Added "Replace in project" functionality
2023-09-21 16:27:58 +02:00
Conrad Irwin
6ad1f19a21 Add NewFileInDirection 2023-09-20 20:44:26 -06:00
Conrad Irwin
a4f96e6452 tests: wait deterministically after simulating_keystrokes 2023-09-20 20:44:26 -06:00
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
Conrad Irwin
5bb8ba5028 Initialize workspace properly in tests
For vim command I'd like to be able to test that e.g. workspace::Save
works.
2023-09-19 20:49:29 -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
Nate Butler
24974ee2fa Unify icons using multiple variants, remove all unused icons 2023-09-15 12:50:49 -04:00
Kirill Bulatov
8c1df5afa2 Empty both hint cache storages correctly 2023-09-15 10:33:32 +03:00
Kirill Bulatov
e7b5880af0 Combine both text and inlay highlights in randomized tests 2023-09-14 23:53:56 +03:00
Kirill Bulatov
f9b70718ac Store hints in the map, not the snapshot 2023-09-14 23:36:33 +03:00
Kirill Bulatov
4e9f0adcef Improve inlay hint cache lookup 2023-09-14 23:31:50 +03: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 Bulatov
396efec6e1 Uncomment the rest of the tests 2023-09-14 22:18:26 +03:00
Kirill Bulatov
47e0535f1c Randomize inlay highlight range start 2023-09-14 22:08:12 +03:00
Kirill Bulatov
129fb62182 Consider offsets in inlay chunks 2023-09-14 22:08:12 +03:00
Kirill Bulatov
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
80b96eb05b Add inlay highlight test 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
Piotr Osiewicz
4cb8647702
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
e0fdc7d0aa Eliminate PaintContext 2023-09-11 09:00:59 -06:00
Nathan Sobo
a24d94cfda Eliminate LayoutContext 2023-09-11 08:47:00 -06:00
Antonio Scandurra
02078140c0 Extract code generation logic into its own module 2023-09-11 11:25:37 +02:00
Nathan Sobo
ebf8b32811 Checkpoint 2023-09-08 16:25:10 -06:00
Nathan Sobo
362b1a44be Merge branch 'main' into storybook 2023-09-08 14:18:44 -06:00
Nathan Sobo
53a50b8df4 Move refreshing to window 2023-09-08 13:27:29 -06:00
Conrad Irwin
5d782b6cf0
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
5f897f45a8 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
1b1d7f22cc Add visual area repeating 2023-09-07 10:45:38 -06:00
Nathan Sobo
37ef28a3bf Merge branch 'main' into storybook 2023-09-07 07:56:57 -06:00
Nathan Sobo
5a778fbde6 Checkpoint 2023-09-06 14:16:15 -06:00
Conrad Irwin
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
aa7b65bbaf Merge branch 'main' into vim-softwrap-word 2023-09-01 12:23:56 -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
Nathan Sobo
2fa9c037c8 Merge remote-tracking branch 'origin' into storybook 2023-09-01 10:08:48 -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
Max Brunsfeld
e0bdd857f1 Fix cursor colors of non-followed collaborators
Co-authored-by: Mikayla <mikayla@zed.dev>
2023-08-30 14:14:18 -07: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
Nathan Sobo
48d3e2d9b9 Move views_to_notify_if_ancestors_change to Window 2023-08-29 21:58:44 -06:00
Nathan Sobo
2e7356a53e Store new_parents on Window instead of layout context 2023-08-29 21:43:48 -06:00
Conrad Irwin
d3650594c3 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 Bulatov
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
Julia
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
Julia
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
52e1e014ad Allow redoing edits performed by inline assistant after cancelling it 2023-08-28 14:42:52 +02: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
38da2a587a Fix the tests 2023-08-27 19:41:15 +03:00
Kirill Bulatov
81e70905bb Do not allow cmd+click in invalid inlay context 2023-08-27 19:12:32 +03:00
Kirill Bulatov
693e91f335 Properly compare previous hover trigger point when hover changes 2023-08-27 18:23:40 +03:00
Kirill Bulatov
dad64edde1 Better highlight hint ranges 2023-08-27 15:14:45 +03:00