Commit graph

19500 commits

Author SHA1 Message Date
Cole Miller
4ff1173047
git: Fill the commit message buffer from MERGE_MSG (#24843)
This PR uses the template merge message in `.git/MERGE_MSG` to populate
the commit message buffer in the git panel. This is done:

- when the commit message buffer is first created
- when the list of merge heads in .git changes, only if the buffer
doesn't already have some text in it

Hopefully this strikes a good balance between convenience and not
stomping on the user's toes.

Release Notes:

- N/A
2025-02-15 18:29:45 +00:00
Cole Miller
394bb8f4e6
Fix a couple of diff hunk issues (#24913)
- Fix hunks losing their expandedness when staged or unstaged
- Disable collapsing hunks in the project diff editor

Release Notes:

- N/A

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-15 18:18:32 +00:00
Conrad Irwin
79e3faffb2
Make save all prompt less noisy (#24934)
Don't show clean items from dirty multibuffers, and dedupe filenames in
case you have a file open in a buffer and a multibuffer

Release Notes:

- N/A
2025-02-14 22:40:14 -07:00
Dino
e0fc767c11
Display case-sensitive keybindings for vim commands (#24322)
This Pull Request tackles the issue outline in #14287 by changing the
way `KeyBinding`s for vim mode are displayed in the command palette.
It's worth pointing out that this whole thing was pretty much
implemented by Conrad Irwin during a pairing session, I just tried to
clean up some other changes introduced for a different issue, while
improving some comments.

Here's a quick list of the changes introduced:

- Update `KeyBinding` with a new `vim_mode` field to determine whether
the keybinding should be displayed in vim mode.
- Update the way `KeyBinding` is rendered, so as to detect if the
keybinding is for vim mode, if it is, only display keys in uppercase if
they require the shift key.
- Introduce a new global state – `VimStyle(bool)` - use to determine
whether `vim_mode` should be enabled or disabled when creating a new
`KeyBinding` struct. This global state is automatically set by the `vim`
crate whenever vim mode is enabled or disabled.
- Since the app's context is now required when building a `KeyBinding` ,
update a lot of callers to correctly pass this context.

And before and after screenshots, for comparison:

| before | after |
|--------|-------|
| <img width="1050" alt="SCR-20250205-tyeq"
src="https://github.com/user-attachments/assets/e577206d-2a3d-4e06-a96f-a98899cc15c0"
/> | <img width="1050" alt="SCR-20250205-tylh"
src="https://github.com/user-attachments/assets/ebbf70a9-e838-4d32-aee5-0ffde94d65fb"
/> |

Closes #14287 

Release Notes:

- Fix rendering of vim commands to preserve case sensitivity

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2025-02-14 22:03:59 -07:00
xzbdmw
14289b5a6e
Fix ReplaceWithRegister with proper dot repeat (#24932)
Release Notes:

- Fixed ReplaceWithRegister with proper dot repeat
2025-02-14 21:32:21 -07:00
Aymen
1b38b9f61d
theme: Add file icon associations for .rdata and .RData files (#24925)
.RData is a file that stores R objects.

Release Notes:

- Added file icon associations for `.rdata` and `.RData` files.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-15 02:04:35 +00:00
Marshall Bowers
e60123bbdc
Allow icon themes to provide their own file associations (#24926)
This PR adds the ability for icon themes to provide their own file
associations.

The old `file_types.json` that was previously used to make these
associations has been removed in favor of storing them on the default
theme.

Icon themes have two new fields on them:

- `file_stems`: A mapping of file stems to icon keys.
- `file_suffixes`: A mapping of file suffixes to icon keys.

These mappings produce icon keys which can then be used in `file_icons`
to associate them to a particular icon:

```json
{
  "file_stems": {
    "Makefile": "make"
  },
  "file_suffixes": {
    "idr": "idris"
  },
  "file_icons": {
    "idris": { "path": "./icons/idris.svg" },
    "make": { "path": "./icons/make.svg" }
  }
}
```

When loading an icon theme, the `file_stems` and `file_icons` fields
will be merged with the ones from the base icon theme, with the values
from the icon theme being loaded overriding ones in the base theme.

Release Notes:

- Added the ability for icon themes to provide their own file
associations.
2025-02-15 00:35:13 +00:00
Randa Zraik
a01d2dd798
file_icons: Add separate icon keys for .NET solution and project files (#24851)
Add separate icon keys for .NET solution and project files.

Release Notes:

- Icon themes: Added the ability to change file icons for Visual Studio
project files:
  - Solution files (`.sln`)
  - Solution User Options files (`.suo`)
  - C# Project files (`.csproj`)
  - F# Project files (`.fsproj`)
  - Visual Basic Project files (`.vbproj`)

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-14 18:19:22 -05:00
Étienne BERSAC
e6749b5955
Use shell script language for bats files (#24877)
bats is a superset of bash. It's a common tool for writing TAP tests in
bash.

https://bats-core.readthedocs.io/en/stable/tutorial.html#your-first-test

Release Notes:

- Added recognition for `.bats` files as "Shell Script".

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-14 17:34:43 -05:00
Richard Weber
5f6311171f
Add SSH port forwards to settings (#24474)
Closes #6920

Release Notes:

- Added ability to specify port forwarding settings for remote
connections
2025-02-14 14:52:24 -07:00
Conrad Irwin
be83074243
Git context menu (#24844)
Adds the non-entry specific right click menu to the panel, and the
features contained therin:

* Stage all
* Discard Tracked Changes
* Trash Untracked Files

Also changes the naming from "Changes"/"New" to better match Git's
terminology (though not convinced on this, it was awkward to describe
"Discard Changes" without a way to distinguish between the changes and
the files containing them).

Release Notes:

- N/A
2025-02-14 14:04:32 -07:00
Kirill Bulatov
bd105a5fc7
Continue improving font adjustment settings (#24908)
Follow-up of https://github.com/zed-industries/zed/pull/24857

Based on the feedback,

* made non-persisting font size change as a default in Zed keymaps
JetBrains IDEs seem to persist font size changes by default, hence left
to do so in Zed keymaps too

* fixed a bug with holding a binding to change the font size caused
flickering

Release Notes:

- N/A
2025-02-14 21:00:56 +00:00
Margret Riegert
3040ef416a
file_icons: Add icon key for Crystal and ECR files (#24903)
Release Notes:

- Icon themes: Added the ability to change the file icon for Crystal
(`.cr`, `.ecr`) files.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-14 15:27:43 -05:00
smit
e37acdeeb8
migrator: Fix keymap task_name regression (#24898)
Closes #24832

Only turns specified deperecated keys and values to snake case.

Release Notes:

- Fixed issue where keybindings would open task selector instead of
spawn that task.
2025-02-15 01:33:30 +05:30
Ashish Bhate
1d26a27afa
go: Fix tree-sitter query for outlines (#24861)
Closes #14497

Release Notes:
- Fixed outline view for Go to correctly indent types and show missing
variables.
----
This PR fixes the tree-sitter query for outlines for Go code. It
correctly indents "grouped" `type` declarations. It also fixes missing
variables for "grouped" `var` declarations.

### Before: 
1. Incorrectly indented types from `G` to `K` and `aliasInt`
2. Missing vars `M` and `N` in outline 

![Screenshot_20250214_175404](https://github.com/user-attachments/assets/7c1142bd-fe60-4c65-9fa2-3bae4eb43d63)

### After:
1. Types no longer indented incorrectly
2. Missing vars `M` and `N` appear in the outline, as expected

![Screenshot_20250214_175431](https://github.com/user-attachments/assets/61010273-e98d-425d-93ad-17f04bd83b54)

### Caveats:
1. This fix comes from an hour or so of reading about tree-sitter and
its query syntax. I'm not an expert.
2. I'm not sure how to test this. I've done manual testing and it
appears to works as expected without an regressions.
2025-02-14 11:45:43 -08:00
Dino
294dea10e8
vim: Change into visual mode on select all matches (#24897)
This Pull Request fixes an issue where selecting all matches on a search
would not update vim to visual mode.

In the video below the following scenarios are tested:

1. Clicking "Select All Matches" in the buffer search bar correctly
changes vim to visual mode
2. Pressing Enter jumps the cursor to the first match and does not
change vim's mode
3. Selecting all matches with the `⌥⏎` changes vim to visual mode


https://github.com/user-attachments/assets/f7535638-987e-4f33-9364-292f99b60167

Thanks @ConradIrwin for both the quick pairing session and the solution!
🙇

Closes #14681 

Release Notes:

- vim: Use visual mode for "select all matches" in search (to be
consistent with `ga`)
2025-02-14 12:37:35 -07:00
Cole Miller
de020af6ef
Fix duplicate hunk controls after splitting DisplayDiffHunk (#24893)
This PR fixes expanded modification hunks having two sets of hunk
controls after #24834.

Release Notes:

- N/A
2025-02-14 18:58:59 +00:00
Conrad Irwin
20460239a0
Fix scroll to top on multibuffer save (#24885)
Co-Authored-By: Cole <cole@zed.dev>

Closes #ISSUE

Release Notes:

- N/A

---------

Co-authored-by: Cole <cole@zed.dev>
2025-02-14 13:18:07 -05:00
Shidfar Hodizoda
7ee492746d
assistant: Add Mistral support (#24879)
Closes #12519.

Release Notes:

- Added support for Mistral to the Assistant.

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-14 13:07:41 -05:00
smit
5c5caf1ffe
linux: Fix reload hangs for several minutes (#24882)
Closes #22666

This PR fixes the long wait time to open Zed (2 mins in my case) after
reloading on Linux.

This bug fix is funny:

1. We were using TCP for Zed instances to talk to each other. Reload was
broken here too due to TCP connections not being killed on time.
2. [#11488](https://github.com/zed-industries/zed/pull/11488) PR fixed
the TCP connection issue by adding a wait until it gets killed. I
suppose at that time, this wait time was small.
3. Later, we changed how Zed talks to each other in
[#11585](https://github.com/zed-industries/zed/pull/11585) by using
Datagram and removing TCP. The new approach simply uses a `.sock` file
and a file descriptor to check if some program is listening to it.
4. TCP check is now unnecessary, and it still wait for a long time (I
suppose, TIME_WAIT time, don't quote me on this), even though we don’t
use TCP anymore for this.

This PR just removes that unnecessary TCP wait.

Release Notes:

- Fixed issue where reload hangs for several minutes on Linux.
2025-02-14 21:54:26 +05:30
Cole Miller
39c9b1f170
Gutter-highlight removed and added portions of expanded diff hunks separately (#24834)
cc @iamnbutler 

Release Notes:

- Color gutter highlights separately for removed and deleted portions of
git modification hunks

Co-authored-by: Conrad <conrad@zed.dev>
2025-02-14 10:31:30 -05:00
Agus Zubiaga
4aae0e2f6c
welcome: Try Zed Edit Prediction (#24876)
Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: Antonio Scandurra <me@as-cii.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-14 10:28:07 -05:00
Kirill Bulatov
744579ede9
Move git status updates to a background thread #2 (#24722)
Follow-up of https://github.com/zed-industries/zed/pull/24307

Brings back the PR and fixes the issue with the git status not
propagated, if computed too slow.
Now, git repo update
* waits in the background for all `scan_dir` repo status updates and
triggers another status update send afterwards
* ensures that the update sent is reported correctly (`scanning = true`)
if either FS or status scan is running still
* during worktree's git statuses updates, bumps `status_scan_id` to
ensure the repo update is reported to all subscribers

Release Notes:

- Improved project panel's speed in large projects
2025-02-14 16:47:11 +02:00
Agus Zubiaga
592e8fbffc
edit predictions: Fix cursor popover edit preview panic (#24866)
Release Notes:

- Fixed a panic when displaying a whitespace-only line in the edit
prediction preview

---------

Co-authored-by: Antonio <antonio@zed.dev>
2025-02-14 15:44:45 +01:00
Piotr Osiewicz
a618830aea
project: Fine-grained language server management (#24038)
Closes #ISSUE
https://github.com/zed-industries/zed/pull/23804
Release Notes:

- Improved detection of project roots for use by language servers.

Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: smit <0xtimsb@gmail.com>
Co-authored-by: Henrikh Kantuni <henrikh.kantuni@gmail.com>
Co-authored-by: Caleb! <48127194+kaf-lamed-beyt@users.noreply.github.com>
Co-authored-by: Marshall Bowers <git@maxdeviant.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Danilo <danilo@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-02-14 15:41:49 +01:00
Agus Zubiaga
8d839fca06
edit predictions: Fix manually requesting completions (#24860)
We were disabling edit predictions altogether when
`show_edit_predictions` was set to `false`. However, even in that case,
`editor::ShowEditPrediction` is supposed to let your request a
prediction manually.

Release Notes:

- Fixed `editor::ShowEditPrediction` when `show_edit_predictions` is set
to `false`.
2025-02-14 10:44:28 -03:00
Sanjeev Shrestha
79ee01eb14
theme: Fix icon theme switching changing the theme (#24849)
Closes #24846 

Release Notes:

- Fixed an issue where changing the icon theme would change the theme.
2025-02-14 08:14:00 -05:00
Kirill Bulatov
3b91de8003
Adds a way to toggle font size without settings adjustments (#24857)
Closes https://github.com/zed-industries/zed/issues/23505

Now `zed::IncreaseBufferFontSize` (and all the same UI- and
Buffer-related settings) action is parameterized with `{ "persist": true
}` (default).
Using `"persist": false` brings back resizing behavior prior to
https://github.com/zed-industries/zed/pull/23265


Release Notes:

- Added a way to toggle font size without settings adjustments
2025-02-14 13:27:48 +02:00
Cole Miller
2f734cbd5e
Fix missing hunks in project diff (#24847)
Release Notes:

- N/A
2025-02-14 01:07:07 -05:00
Mikayla Maki
5d26ce14d7
Centralize the CopyPath and CopyRelativePath actions to zed_actions (#24836)
I spent an hour with @marcospb19 this morning debugging an issue with
adding `Copy Path` and `Copy Relative Path` actions to the editor
context menu. Turned out that the problem was using
`workspace::CopyPath` in the menu and `editor::CopyPath` in the action
handler.

This is an easy mistake to make, so let's fix it for everyone.

Release Notes:

- N/A
2025-02-13 23:30:44 +00:00
Marshall Bowers
c38deb1430
zeta: Remove predict-edits-launch feature flag (#24829)
This PR removes the `predict-edits-launch` feature flag that was added
in #24720.

We don't need this anymore now that we've launched!

Release Notes:

- N/A
2025-02-13 21:48:09 +00:00
Marshall Bowers
8af54c589b
zeta: Update URL to edit prediction blog post (#24828)
This PR updates the URL to the edit prediction blog post.

Release Notes:

- N/A
2025-02-13 21:03:26 +00:00
Nate Butler
8c202b3b09
editor: Update git hunk indicators to show staging status when hunk is expanded (#24818)
- Update git hunk indicators to show staging status when hunk is
expanded
- Updates uses of status colors to the new version control theme colors
- Adds new version control theme colors to included themes

Before:

![CleanShot 2025-02-13 at 14 42
48@2x](https://github.com/user-attachments/assets/ccca147e-0de2-4e69-9cd4-01b010bf06d0)

After:

![CleanShot 2025-02-13 at 14 42
04@2x](https://github.com/user-attachments/assets/1ab49174-bde5-43b2-83c5-d217533df49a)

(Colors here are from before theme colors were added)


Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: cole-miller <m@cole-miller.net>
2025-02-13 20:12:23 +00:00
Cole Miller
a6a8d79d86
Rework hunk controls (#24814)
- Remove prev hunk arrow
- Replace next hunk arrow with "Skip" labelled button
- New "Stage"/"Unstage" labelled button

cc @iamnbutler 

Release Notes:

- N/A

---------

Co-authored-by: Nate <nate@zed.dev>
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
2025-02-13 19:38:20 +00:00
Marshall Bowers
74e8164cd7
collab: Remove POST /snowflake/events endpoint (#24817)
This PR removes the `POST /snowflake/events` endpoint that was added in
#23842, as it is no longer used.

Release Notes:

- N/A
2025-02-13 14:31:57 -05:00
Agus Zubiaga
16ffddf48d
edit predictions: Prefer keybinding with least modifiers when not in conflict mode (#24812)
This workaround a gpui issue where we don't pick the right keybinding

Release Notes:

- N/A
2025-02-13 17:15:53 +00:00
Conrad Irwin
2f741c8686
vim: Fix :wq in multibuffer (#24603)
Supercedes #24561
Closes #21059

Before this change we would skip saving multibuffers regardless of the
save intent. Now we correctly save them.

Along the way:
* Prompt to save when closing the last singleton copy of an item (even
if it's still open in a multibuffer).
* Update our file name prompt to pull out dirty project items from
multibuffers instead of counting multibuffers as untitled files.
* Fix our prompt test helpers to require passing the button name instead
of the index. A few tests were passing invalid responses to save
prompts.
* Refactor the code a bit to hopefully clarify it for the next bug.

Release Notes:

- Fixed edge-cases when closing multiple items including multibuffers.
Previously no prompt was generated when closing an item that was open in
a multibuffer, now you will be prompted.
- vim: Fix :wq in a multibuffer
2025-02-13 17:13:43 +00:00
Cole Miller
8c780ba287
Fix branches with slashes in their names not being listed (#24809)
`refs/heads/*` doesn't match e.g. `refs/heads/cole/branch-with-slash`
(thanks fnmatch), but `refs/heads/**/*` does. This also works for
several levels of slash.

Release Notes:

- N/A
2025-02-13 15:32:23 +00:00
Cole Miller
de0d9d678e
Save open buffers before staging or unstaging their backing files (#24767)
Release Notes:

- N/A
2025-02-13 15:07:28 +00:00
Agus Zubiaga
2db5eed840
edit predictions: Do not use conflict context for other providers (#24807)
This is to avoid confusing copilot/supermaven users when the cursor is
on leading whitespace.

Release Notes:

- N/A
2025-02-13 14:59:52 +00:00
Agus Zubiaga
c3afeda80b
Make edit prediction bindings backwards compatible with existing user keymaps (#24802)
Release Notes:

- N/A

---------

Co-authored-by: Antonio <antonio@zed.dev>
2025-02-13 14:22:08 +00:00
Conrad Irwin
d57f5937d4
Git panel: Right click menu (#24787)
Release Notes:

- N/A
2025-02-12 22:26:34 -07:00
Joseph T. Lyons
fc7bf7bcb9
Bump Zed to v0.175 (#24785)
Release Notes:

-N/A
2025-02-12 23:14:45 -05:00
tidely
5d634245a2
remote_server: Remove unnecessary Box, prevent time-of-check time-of-use bug (#24730)
The MultiWrite struct is defined in the function scope and is allowed to
have a concrete type, which means we can throw away the extra Box.
PathBuf::exists is known to be prone to invalid usage. It doesn't take
into account permissions errors and just returns false, additionally it
introduces a time-of-check time-of-use bug. While extremely unlikely,
why not fix it anyway.

Release Notes:

- remove unnecessary Box
- prevent time-of-check time-of-use bug
2025-02-12 20:55:22 -07:00
Conrad Irwin
21a1541a70
Branch/co-authors in commit (#24768)
- **branch selector in commit box**
- **TEMP**
- **Add co-authors toggle button**

Closes #ISSUE

Release Notes:

- N/A *or* Added/Fixed/Improved ...

---------

Co-authored-by: Mikayla <mikayla@zed.dev>
2025-02-12 20:53:52 -07:00
Max Brunsfeld
71867096c8
Migrate edit_prediction_provider setting before updating its value to 'zed' during onboarding (#24781)
This fixes a bug where we'd update your settings to an invalid state if
you were using the old `inline_completion_provider` setting, then
onboarded to Zeta, then migrated your settings.

Release Notes:

- N/A

Co-authored-by: Michael Sloan <mgsloan@gmail.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
2025-02-13 02:35:25 +00:00
Danilo Leal
3d68dba696
edit predictions: Iterate on onboarding modal copywriting (#24779)
Release Notes:

- N/A

---------

Co-authored-by: Nathan Sobo <1789+nathansobo@users.noreply.github.com>
2025-02-13 02:07:20 +00:00
Michael Sloan
a13c2baa7f
Improve error message for AcceptEditPredictions - add docs link (#24772)
The docs have not been updated yet, this is anticipating their presence
soon.


![image](https://github.com/user-attachments/assets/bbcf56f2-6d5b-460b-8ed0-36bef3b4f12f)

Release Notes:

- N/A
2025-02-12 17:46:53 -07:00
Michal Vrbata
7ba1492f0a
file_icons: Add separate icon key for Bicep files (#24757)
This PR adds support for bicep file icon:

Release Notes:

- Icon themes: Added the ability to change the file icon for Bicep
(`.bicep`) files.
2025-02-13 00:36:27 +00:00
Danilo Leal
0a681225b6
edit predictions: Enable blog post link behind a feature flag (#24720)
This PR updates the blog post link in the onboarding modal to be behind
the `predict-edits-launch` feature flag instead of a staff flag.

This will allow us to enable the blog post link once we're live.

Release Notes:

- N/A

---------

Co-authored-by: Marshall Bowers <git@maxdeviant.com>
2025-02-12 23:59:06 +00:00