Also:
* Adds `impl_internal_actions!` for deriving the `Action` trait without
registering.
* Removes some deserializers that immediately fail in favor of
`#[serde(skip)]` on fields where they were used. This also omits them
from the schema.
Release Notes:
- Keymap settings file now has more JSON schema information to inform
`json-language-server` completions and info, particularly for actions
that take input.
I added these notifies in #23011, but in practive have found them to be
overly disruptive. It would definitely be good to do something better
than logging here, but having a sticky error notification is worse. I
think it is still good to notify on mutation failures, so left those in
In particular with rust-analyzer, "Go to definition" and "Find
references" frequently fail with "Content modified" quite a while after
sending the request. Since users are probably used to these operations
being finicky it doesn't seem useful to have a prominent display of
errors for them.
This adds support for LSPs that use the old rename flow which does not
first ask the LSP for the rename range and check that it is a valid
range to rename.
Closes#16663
Release Notes:
* Fixed rename symbols action when the language server does not have the
capability to prepare renames - such as `luau-lsp`.
Not sure why scroll was janky with `Autoscroll::newest()`, but this
appears to fix it. Probably better to conditionally do the autoscroll
requests anyway.
Release Notes:
- N/A
Closes#18737
Release notes:
- Improved LSP debug logs by defaulting to soft wrap and folding a
suffix of long lines. Also adds autoscroll, so if the cursor is on the
last line of the logs they will scroll like `tail`.
Before this change, inline completion would displace the user's
selection. Unfortunately this brings less visibility to the inline
completion, I think a good solution to this will be to display a chunk
of the completion inline in the menu, and have a WIP change for that.
Since the current behavior is frustrating, not blocking this improvement
on that
Release Notes:
- N/A
Follow-up of https://github.com/zed-industries/zed/pull/22866
Added a config option to the markdown renderer to omit code copying
buttons, and used those for editor hover popovers.
Such popovers are quite frequent in language servers' hover responses,
e.g. rust-analyzer on `.clone()` hover may respond with
```
{"jsonrpc":"2.0","id":119,"result":{"contents":{"kind":"markdown","value":"\n```rust\nalloc::string::String\n```\n\n```rust\nfn clone(&self) -> Self\n```\n\n---\n\nReturns a copy of the value.\n\n# Examples\n\n```rust\nlet hello = \"Hello\"; // &str implements Clone\n\nassert_eq!(\"Hello\", hello.clone());\n```"},"range":{"start":{"line":518,"character":24},"end":{"line":518,"character":29}}}}
```
(note multiple code blocks sent)
![image](https://github.com/user-attachments/assets/4c40b15e-8f53-4b3d-a809-f1e4d35a00a7)
![image](https://github.com/user-attachments/assets/77b8e13b-b665-42d3-b633-5a0375998f06)
Sounds that editor has either to use a different way to copy popover's
data (so the entire text gets copied, not just its code blocks), or at
least better handle hover popover's hovering to show the button.
Release Notes:
- N/A
Before this change it was using the same multibuffer point ranges in
every buffer, which only worked correctly for singleton buffers.
Release Notes:
- Fixed handling of selection ranges when formatting selections within a
multibuffer.
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This changes the behaviour of `<tab>` when inline completion is visible.
When the cursor is before the suggested indentation level, accepting a
completion should just indent.
cc @nathansobo @maxdeviant
Release Notes:
- Changed the behavior of `<tab>` at start of line when an inline
completion (Copilot, Supermaven, ...) is visible. If the cursor is
before the suggested indentation, `<tab>` now indents the line instead
of accepting the visible completion.
Co-authored-by: Antonio <antonio@zed.dev>
This fixes the issue described in this comment:
https://github.com/zed-industries/zed/pull/22439#issuecomment-2563896422
Essentially, we'd clip in the wrong direction when there were multi-line
inlay hints.
It also fixes inline completions for non-Zeta-providers showing up in
normal mode.
Release Notes:
- N/A
Co-Authored-By: Thorsten <thorsten@zed.dev>
Release Notes:
- Fix selected suggestion updating too many times when Zeta triggers
Co-authored-by: Thorsten <thorsten@zed.dev>
fixed a bug where with the "show_whitespaces": "boundary" option, when
there was an "à" followed by a space, a white space was displayed, and
when "à" was at the end of the line, a white space was added
Release Notes:
- N/A
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Closes#9656. Continuation of #9654, but with the addition of backwards
compatibility for the existing captures.
Release Notes:
- Improved Tree-sitter support with added compatibility for standard
injections captures
---------
Co-authored-by: Finn Evers <finn.evers@outlook.de>
Closes#22720
Release Notes:
- `ExpandExcerpts` (`shift+enter` by default) now expands all excerpts
that have selected text, rather than just excerpts that contain the end
of a selection.
This will allow the diagnostic popover to be displayed even if hovering
an invisible char.
Beyond that, it solves a rare `DiagnosticPopover` corner case:
* Supports moving the selection to a diagnostic when `GoToDiagnostic` is
done while hovering, based on `group_id`
* Provides Diagnostic values with `group_id: 0` providing information on
hover about invisible characters.
So, `GoToDiagnostic` would navigate to the very first error produced by
a language server. Really not a big deal of course.
Release Notes:
- N/A
No need to find or store the primary range ahead of time as it's found
by `activate_diagnostics`.
Not entirely sure we should still even have the special case when the
popover is visible. It does support the keyboard interaction of opening
hover followed by jumping to the primary position, but that seems pretty
undiscoverable.
Support for clicking the hover to navigate to the primary diagnostic was
removed in https://github.com/zed-industries/zed/pull/3408
Release Notes:
- N/A
In #22620 `diagnostic_group` was modified to return results for
multibuffers, but was returning singleton buffer points. `hover_popover`
uses it to find the jump target for clicking the popup - which doesn't
seem to be working right now but that's a separate issue. Now that
`diagnostic_group` is returning values in multibuffers converting these
to anchors was crashing.
Also resolves a potential bug - if folding in multibuffers was supported
then "Go To Diagnostics" would not properly skip diagnostics from folded
regions.
Release Notes:
- N/A
- [x] Rewrite worktree git handling
- [x] Fix tests
- [x] Fix `test_propagate_statuses_for_repos_under_project`
- [x] Replace `WorkDirectoryEntry` with `WorkDirectory` in
`RepositoryEntry`
- [x] Add a worktree event for capturing git status changes
- [x] Confirm that the local repositories are correctly updating the new
WorkDirectory field
- [x] Implement the git statuses query as a join when pulling entries
out of worktree
- [x] Use this new join to implement the project panel and outline
panel.
- [x] Synchronize git statuses over the wire for collab and remote dev
(use the existing `worktree_repository_statuses` table, adjust as
needed)
- [x] Only send changed statuses to collab
Release Notes:
- N/A
---------
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Mikayla <mikayla@zed.com>
Co-authored-by: Nathan <nathan@zed.dev>
Clicking buffer headers and line numbers would sometimes take you to a
disorienting scroll position. This PR improves that so the destination
line is roughly at the same Y position as it appeared in the
multibuffer.
https://github.com/user-attachments/assets/3ad71537-cf26-4136-948f-c5a96df57178
**Note**: The alignment won't always be perfect because the multibuffer
and target buffer might start at a different absolute Y position
(because of open search, breadcrumbs, etc). I wanted to compensate for
that, but that requires a fundamental change that I'd prefer to make
separately.
Release Notes:
- Fix vertical alignment when jumping from multibuffers
This PR updates the scrollbar diagnostic setting to provide fine-grained
control over which indicators to show, based on severity level. This
allows the user to hide lower-severity diagnostics that can otherwise
clutter the scrollbar (for example, unused or disabled code).
The options are set such that the existing boolean setting has the same
effect: when `true` all diagnostics are shown, and when `false` no
diagnostics are shown.
Closes#22296.
Release Notes:
- Added fine-grained control of scrollbar diagnostic indicators.
Changes:
- [x] Increase expand affordance surface area
- [x] Ensure expand buttons have tooltips with keybindings
- [x] Make line numbers clickable to jump you to location (only in
multibuffers)
- [x] Hide the "Jump To File" element in not-focused excerpts
Before merging it:
- [x] Fix off-by-one header focus styles glitch
Improvements to consider for follow-up PRs:
1. Experiment with increasing the width of the clickable surface area
for line numbers
2. Don't show (or disable) the "expand excerpt" button when at the top
or bottom edge of the file
3. Once you jump to location, centralize the cursor scroll position
Release Notes:
- Improved multibuffer's "expand excerpt" affordance
- Fixed "jump to file/location" and "expand excerpt" keybinding display
- Made clicking on line numbers in multibuffers jump you to cursor
location in file
---------
Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
This slashes our incremental dev times (touch editor) by 0.6s
(8.1->7.6s) due to unblocking terminal_view build sooner.
Closes #ISSUE
Release Notes:
- N/A
* Remove unnecessary WindowContext and ViewContext '_ lifetimes
* Removed some cases where WindowContext has a different name than `cx`.
Release Notes:
- N/A
Closes https://github.com/zed-industries/zed/issues/19214
Closes https://github.com/zed-industries/zed/pull/22443
Adds `resolved` property into Zed completion item data, to ensure we
resolve every completion item exactly once.
There are 2 paths for singplayer Zed, and corresponding 2 analogues for
multi player code, where resolve may happen:
* completions menu display & selection, that ends up using
`resolve_completions` in `lsp_store.rs`
* applying a completion menu entry, that ends up using
`apply_additional_edits_for_completion` in `lsp_store.rs`
Now, all local counterparts check `enabled` field before resolving and
set it to true afterwards, and reuse the same `resolve_completion_local`
method for resolving the items.
A logic for re-generating docs and item labels was moved out from the
`resolve_completion_local` method into a separate method, as
`apply_additional_edits_for_completion` does not need that, but needs
the rest of the logic for resolving.
During the extraction, I've noted that multiplayer clients are not
getting the item labels, regenerated after the resolve — as the Zed
protocol-based flow is not the exact copy of the local resolving.
To improve that, `resolve_completion_remote` needs to be adjusted, but
this change is omitted to avoid bloating the PR.
Release Notes:
- Fixed autocomplete inserting multiple imports
* Now more often displayed to the right. Resizes docs width if more
space than min width is available.
* If constrained in horizontal space and so displayed above/below resize
docs height to fit.
* Makes space for scrollbar and gap.
Layout is imperfect for viewport sizes smaller than the context menu,
left TODOs in the code for handling this. Wanted to get this change out
for feedback first.
Release Notes:
- N/A
Makes a first pass over git panel UI, making it more interactive.
![image](https://github.com/user-attachments/assets/4d43b086-4ef2-4913-9783-2b9467d99c9a)
* every item can be selected, the selection is shown in the panel
* every item can be clicked, which changes the selection and
creates/focuses the editor with a project changes multi buffer
* the editor is scrolled so that the clicked item is in the center
* it's possible to nagivate up and down the panel, selecting
next/previous items in it, triggering the editor scroll
Known issues:
* entries are updated oddly sometimes (should become better after
DiffMap improvements land?)
* only unstaged diffs are shown currently (entry status storage should
help with this)
* no deleted files are displayed (the underlying work is done by others
now)
* added files have no diff hunks shown (DiffMap will have it?)
* performance story has not improved (again, DiffMap and status storage
should help with this)
Release Notes:
- N/A
This is quite experimental and untested in languages other than Rust.
It's written to attempt to do something sensible in many languages. Due
to its experimental nature, just releasing to staff, and so not
including it in release notes. Future release note might be "Improved
diagnostic excerpts by using syntactic info to determine the context
lines to show."
Release Notes:
- N/A
Leaving release notes as N/A because it had release notes in the past in
#21705
In #21286, documentation resolution was made more efficient by only
resolving the current completion. However, this meant that single line
documentation shown inline in the menu was missing until scrolled
to. This also meant that it would wait for navigation to resolve
completion docs, leading to lag for displaying documentation.
This change resolves this by attempting to fetch all the completions
that will be shown. It also mostly avoids re-resolving completions. It
intentionally re-resolves the current selection on navigation, as some
language servers will respond with more information later on.
Release Notes:
- N/A
We've received a complaint on Discord about bad multicursor performance.
I too run 15k cursor simultaneously. The gist of the issue was in the
lsp_ext; whenever we gather up actions to be registered on a buffer, we
need to know whether a buffer has any of the languages for which we have
LSP extensions. The problem stemed from the fact that we did a two-phase
filtering. For each selection we'd first check whether this selection
lies in a part of a file that is part of a language for which we have
LSP extensions. Then, we'd check whether we're running a language server
of interest for this buffer.
This is not optimal, because it would often do the redundant work:
1. We resolve selections for buffer that are known to not contain a
given language server.
2. We look up language server in the LspStore once per each matching
selection.
In case where the file is not related at all, we end up resolving all of
the selections which is pretty bad. This PR makes us skip buffers which
are known to not match the criteria. It also caches the result of
language server lookup for the buffers.
Closes #ISSUE
Release Notes:
- Improved performance with large quantity of cursors
This PR ensures that, for fixed-width fonts, the cursor width is the
same on blank lines as on non-blank lines, as well as at the end of a
line. It does so by using the em advance to define the cursor width
instead of the em width in these cases.
Note that this can look... bizarre on non-fixed-width fonts:
<img width="93" alt="Screenshot 2024-12-19 at 21 43 11"
src="https://github.com/user-attachments/assets/a4c9b26c-98ea-4a1d-947b-51f1acd3c2f8"
/>
However, this is arguably reasonably consistent with how (terminal) Vim
handles it:
<img width="45" alt="Screenshot 2024-12-19 at 21 46 42"
src="https://github.com/user-attachments/assets/ec3ff614-7a15-4cc3-8d14-3d15ce62f2b8"
/>
Closes#22260.
Release Notes:
- N/A