This PR updates the `ToolWorkingSet` to reduce the amount of locking we
need to do.
A number of the methods have had corresponding versions moved to the
`ToolWorkingSetState` so that we can take out the lock once and do a
number of operations without needing to continually acquire and release
the lock.
Release Notes:
- N/A
This adds the ability for the editor to implement hard wrap (similar to
"textwidth" in vim).
If you are typing and your line extends beyond the limit, a newline is
inserted before the most recent space on the line. If you are otherwise
editing the line, pasting, etc. then you will need to manually rewrap.
Release Notes:
- git: Commit messages are now wrapped "as you type" to 72 characters.
This moves spawning of the git subprocess to the main thread. We're not
yet
sure why, but when we spawn a process using GCD's background queues,
sub-processes like git-credential-manager fail to open windows.
This seems to be fixable either by using the main thread, or by using a
standard background thread,
but for now we use the main thread.
Release Notes:
- Git: Fix git-credential-manager
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Closes https://github.com/zed-industries/zed/issues/26431
Follow-up of https://github.com/zed-industries/zed/pull/26174
`path_with_position.path.strip_prefix(&worktree_root)` used in the PR is
wrong for cases of single-file worktrees, where it will return empty
paths that will result in incorrect project and FS entries accessed.
Release Notes:
- Fixed goto single file worktrees during terminal cmd-clicks
Closes https://github.com/zed-industries/zed/issues/4957https://github.com/user-attachments/assets/ff491378-376d-48ec-b552-6cc80f74200b
Adds `"completions"` language settings section, to configure LSP and
word completions per language.
Word-based completions may be turned on never, always (returned along
with the LSP ones), and as a fallback if no LSP completion items were
returned.
Future work:
* words are matched with the same fuzzy matching code that the rest of
the completions are
This might worsen the completion menu's usability even more, and will
require work on better completion sorting.
* completion entries currently have no icons or other ways to indicate
those are coming from LSP or from word search, or from something else
* we may work with language scopes more intelligently, group words by
them and distinguish during completions
Release Notes:
- Supported word-based completions
---------
Co-authored-by: Max Brunsfeld <max@zed.dev>
Closes #ISSUE
Release Notes:
- Fix Bug where unstage/stage all in project diff wouldn't work while
git panel was closed
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Previously, if a user clicked a button and moved the cursor out before
releasing, the click event was correctly prevented, but the pending
mouse-down state remained.
This caused unintended drags when the UI shifted due to magnification
settings.
Now, mouse-up clears the pending state:
- If over the button → clear state and trigger click handlers.
- If outside the button → clear state without triggering a click.
This avoids accidental drags while preserving expected click behavior.
Closes#24600
Release Notes:
- N/A
---------
Co-authored-by: Ben Kunkle <ben@zed.dev>
This PR adds a new `ExtensionEvents` event bus that can be used to
listen for extension-related events throughout the app.
Today you need to have a handle to the `ExtensionStore` (which entails
depending on `extension_host`) in order to listen for extension events.
With this change subscribers only need to depend on `extension`, which
has a leaner dependency graph.
Release Notes:
- N/A
Assertions on the parsed system prompt should use CRLF on Windows. I
didn't see it before because I was testing on my Windows VM from a
shared folder I cloned on macOS.
Release Notes:
- N/A
Closes#26534
Recently, we fixed a title bar transparency issue that only occurred on
macOS 15.3 and later. PR:
https://github.com/zed-industries/zed/pull/26403
However, this seems to have broken multi-window fullscreen behavior on
earlier macOS versions. This PR adds versioning so that the title bar
transparency fix only applies to macOS 15.3.0 and later.
No release notes, as this bug only exists on main right now.
Release Notes:
- N/A
Co-authored-by: MrSubidubi <dev@bahn.sh>
#26538 fixed part of the issue, but it would keep trailing carriage
returns in the old/new strings. The model is unlikely to produce those,
but we might as well support them.
Release Notes:
- N/A
Release Notes:
- N/A
Yesterday I worked on https://github.com/zed-industries/zed/pull/26482
and noticed afterwards that we have duplicated hosting providers if the
git remote host is "gitlab.com" and after the PR also for "github.com".
This is not a big problem, since the original providers are registered
first and therefore we first find a match with the original providers,
but I think we should address this nevertheless.
We initialize every hosting provider with the defaults here:
b008b2863e/crates/git_hosting_providers/src/git_hosting_providers.rs (L15-L24)
After that, we also register additional hosting providers:
b008b2863e/crates/git_hosting_providers/src/git_hosting_providers.rs (L30-L43)
If we do not check if the additional provider is not the original
provider, we will register the same provider twice.
---------
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Disables https://github.com/zed-industries/zed/pull/26146 until a better
way to add diagnostics is found.
Overall, the PR had made changes that are worth keeping instead of
reverting, such as finally extracting out r-a's language server logic
into an `_ext.rs` file.
Release Notes:
- N/A
This should be less eager in terms of invoking tools. But we should keep
iterating on it as we add more tools.
Also, this disables the Lua interpreter by default (it can still be
enabled manually from the tools icon).
Release Notes:
- N/A
---------
Co-authored-by: Richard Feldman <oss@rtfeldman.com>
Exposes a new "edit files" tool that the model can use to apply
modifications to files in the project. The main model provides
instructions and the tool uses a separate "editor" model (Claude 3.5 by
default) to generate search/replace blocks like Aider does:
````markdown
mathweb/flask/app.py
```python
<<<<<<< SEARCH
from flask import Flask
=======
import math
from flask import Flask
>>>>>>> REPLACE
```
````
The search/replace blocks are parsed and applied as they stream in. If a
block fails to parse, the tool will apply the other edits and report an
error pointing to the part of the input where it occurred. This should
allow the model to fix it.
Release Notes:
- N/A
---------
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Closes #ISSUE
Release Notes:
- Git Beta: fixed an issue where pressing `up` or `down` in the git
panel's commit message editor would change the selected status entry
This PR does not close an issue, but it is an issue and and fix in one.
I hope this is ok, but please let me know if you prefer me to open an
issue before.
Release Notes:
- Add "copy permalink" action for self-hosted GitHub enterprise
instances
# Issue
### Related issues:
* https://github.com/zed-industries/zed/issues/26393
* https://github.com/zed-industries/zed/issues/11043
When you try to copy a permalink from a self-hosted GitHub enterprise
instance, you get the following error:
<img width="383" alt="permalink"
src="https://github.com/user-attachments/assets/b32338a7-a2d7-48fc-86bf-ade1d32ed1f7"
/>
You also cannot open a PR or commit when you hover over a git blame:
https://github.com/user-attachments/assets/a5491ce7-270b-412f-b9ac-027ec020b028
### Reproduce
If you do not have access to a self-hosted GitHub instance, you can
change the remote url of any git repo:
```
git remote set-url origin git@github.mycorp.com:nilskch/zed.git
```
With the fix, permalinks still won't bring you to a valid website, but
you can verify that they are correctly created.
# Solution
Currently, we only support detecting self-hosted GitLab instances, but
not self-hosted GitHub instances. We detect GitLab instances by checking
if "gitlab" is part of the git URL.
This PR adds the same logic to detect self-hosted GitHub enterprise
instances (by checking if "github" is in the URL).
This solution is not ideal, since self-hosted GitHub or GitLab instances
might not contain the word "github" or "gitlab". #26393 proposes adding
a setting that would allow users to map specific domains to their
corresponding git provider types. This mapping would help Zed correctly
identify the appropriate git instance, even if "gitlab" or "github" are
not part of the URL.
This PR does not implement the offered solution, but I added a TODO
where the fix for #26393 has to make changes.
Previously, when a file was deleted externally and the warning prompt
was dismissed with "Close", the panel remained but was empty, leaving an
unused split space.
This happened because pane.remove_item(...) was being called with
close_pane_if_empty set to false, preventing the panel from being
removed even when it had no remaining items.
This fix changes the third boolean parameter to true, ensuring that the
panel is removed if it becomes empty, allowing the layout to properly
resize.
Closes#23904
Release Notes:
- N/A
Known Issues:
- When items can horizontal scroll, the right selected border is hidden
TODO:
- [ ] Width calculation is off
- [ ] When scrollbars should autohide they don't until hovering the
panel
- [ ] When switching to and from scrollbar track being visible we are
missing a notify somewhere.
Release Notes:
- Git Panel: Added horizontal scrolling in the git panel
---------
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>
This PR refactors the `ContextMenu::render` method to extract a couple
smaller methods from it.
The existing `render` method was suffering from its size, with some of
the `match` arms not being able to be formatted with `rustfmt`.
Release Notes:
- N/A
Release Notes:
- Git Beta: improved the stage-and-next and unstage-and-next actions in
the project diff editor to start a commit after acting on the last hunk
The notifications from git output could take up variable amounts of
screen space, and they were quite obnoxious when a git command printed
lots of output, such as fetching many new branches or verbose push
hooks.
This change makes the push/pull/fetch buttons trigger a small
notification toast, based on the output of the command that was ran. For
errors or commands with more output the user may want to see, there's an
"Open Log" button which opens a new buffer with the output of that
command.
It also uses this behavior for long error notifications for other git
commands like `commit` and `checkout`. The output of those commands can
be quite long due to arbitrary githooks running.
Release Notes:
- N/A
---------
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>