19aba43
Add Tailwind CSS support for Gleam (#43968)
Click to expand commit body
Currently, Zed does not provide suggestions and validations for Gleam,
as it is only available for languages specified in `tailwind.rs`. This
pull-request adds Gleam to that list of languages.
After this, if Tailwind is configured to work with Gleam, suggestions
and validation appear correctly.
Even after this change, Tailwind will not be able to detect and give
suggestions in Gleam directly. Below is the config required for Tailwind
classes to be detected in all Gleam strings.
<details><summary>Zed Config for Tailwind detection in Gleam</summary>
<p>
```
{
"languages": {
"Gleam": {
"language_servers": [
"gleam",
"tailwindcss-language-server"
]
}
},
"lsp": {
"tailwindcss-language-server": {
"settings": {
"experimental": {
"classRegex": [
"\"([^\"]*)\""
]
}
}
}
}
}
```
The `classRegex` will match all Gleam strings, making it work seamlessly
with Lustre templates and plain string literals.
</p>
</details>
Release Notes:
- Added support for Tailwind suggestions and validations for the [Gleam
programming language](https://gleam.run/).
Arjun Bajaj
created
8d09610
git_ui: Fix utf8 panic in `compress_commit_diff` (#43972)
f445f22
Add an action listener to workspace for ActivatePreviousItem and ActivateNextItem (#42588)
Click to expand commit body
Release Notes:
- pane::ActivatePreviousItem and pane::ActivateNextItem now toggle the
most recent pane when called from a dock panel
a couple months ago i posted a work around that used `SendKeystrokes` to
cycle through pane items when focused on a dock.
#35253
this pr would add this functionality to the these actions by default.
i implemented this by adding an action listener to the workspace level.
------
if the current context is a dock that does not hold a pane
it retrieves the most recent pane from `activation_history` and
activates the next item on that pane instead.
- `"Pane > Editor"`
cycles through the current pane like normal
- `"Dock > Pane > Terminal"`
also cycles through the pane items like normal
- `"Dock > (Any Child that is not a child of Pane)"`
cycles through the items of the most recent pane.
this is the standard behavior in VS Code i believe.
in the video below you can see the actions cycling through the editor
like normal when focus is on the editor.
then you can see the editor continue to cycle when the focus is on the
project panel.
and that the focus stays on the project panel.
and you can see the action cycle the terminal items when the focus is
moved to the terminal
https://github.com/user-attachments/assets/999ab740-d2fa-4d00-9e53-f7605217e6ac
the only thing i noticed is that for this to work the keybindings must
be set above `Pane`
so they have to be set globally or on workspace. otherwise they do not
match in the context
Josh Piasecki
created
6216af9
Allow dynamic `set_theme` based on `Appearance` (#42812)
Click to expand commit body
Tracking Issue (does not close):
https://github.com/zed-industries/zed/issues/35552
This is somewhat of a blocker for
https://github.com/zed-industries/zed/pull/40035 (but also the current
behavior doesn't really make sense).
The current behavior of `ThemeSelectorDelegate::set_theme` (the theme
selector menu) is to simply set the in-memory settings to `Static`,
regardless of if it is currently `Dynamic`. The reason this doesn't
matter now is that the `theme::set_theme` function that updates the
user's settings file _will_ make this check, so dynamic settings stay
dynamic in `settings.json`, but not in memory.
But this is also sort of strange, because `theme::set_theme` will set
the setting of whatever the old appearance was to the new theme name. In
other words, if I am currently on a light mode theme and I change my
theme to a dark mode theme using the theme selector, the `light` field
of `theme` in `settings.json` is set to a dark mode theme!
_I think this is because displaying the new theme in the theme selector
does not update the global context, so
`ThemeSettings::get_global(cx).theme.name(appearance).0` returns the
original theme appearance, not the new one._
---
This PR makes `ThemeSelectorDelegate::set_theme` keep the current
`ThemeSelection`, as well as changes the behavior of the
`theme::set_theme` call to always choose the correct setting to update.
One edge case that might be slightly strange now is that if the user has
specified the mode as `System`, this will now override that with the
appearance of the new theme. I think this is fine, as otherwise a user
might set a dark theme and nothing will change because the
`ThemeAppearanceMode` is set to `light` or `system` (where `system` is
also light).
I also have an `unreachable!` in there that I'm pretty sure is true but
I don't really know how to formally prove that...
Release Notes:
- N/A *or* Added/Fixed/Improved ...
---------
Signed-off-by: Connor Tsui <connor.tsui20@gmail.com>
This PR adds word/character diff for expanded diff hunks that have both
a deleted and added section, as well as a setting `word_diff_enabled` to
enable/disable word diffs per language.
- `word_diff_enabled`: Defaults to true. Whether or not expanded diff
hunks will show word diff highlights when they're able to.
### Preview
<img width="1502" height="430" alt="image"
src="https://github.com/user-attachments/assets/1a8d5b71-449e-44cd-bc87-d6b65bfca545"
/>
### Architecture
I had three architecture goals I wanted to have when adding word diff
support:
- Caching: We should only calculate word diffs once and save the result.
This is because calculating word diffs can be expensive, and Zed should
always be responsive.
- Don't block the main thread: Word diffs should be computed in the
background to prevent hanging Zed.
- Lazy calculation: We should calculate word diffs for buffers that are
not visible to a user.
To accomplish the three goals, word diffs are computed as a part of
`BufferDiff` diff hunk processing because it happens on a background
thread, is cached until the file is edited, and is only refreshed for
open buffers.
My original implementation calculated word diffs every frame in the
Editor element. This had the benefit of lazy evaluation because it only
calculated visible frames, but it didn't have caching for the
calculations, and the code wasn't organized. Because the hunk
calculations would happen in two separate places instead of just
`BufferDiff`. Finally, it always happened on the main thread because it
was during the `EditorElement` layout phase.
I used Zed's
[`diff_internal`](https://github.com/zed-industries/zed/blob/02b2aa6c50c03d3005bec2effbc9f87161fbb1e8/crates/language/src/text_diff.rs#L230-L267)
as a starting place for word diff calculations because it uses
`Imara_diff` behind the scenes and already has language-specific
support.
#### Future Improvements
In the future, we could add `AST` based word diff highlights, e.g.
https://github.com/zed-industries/zed/pull/43691.
Release Notes:
- git: Show word diff highlight in expanded diff hunks with less than 5
lines.
- git: Add `word_diff_enabled` as a language setting that defaults to
true.
---------
Co-authored-by: David Kleingeld <davidsk@zed.dev>
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: cameron <cameron.studdstreet@gmail.com>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Anthony Eid
,
David Kleingeld
,
Cole Miller
,
cameron
, and
Lukas Wirth
created
2df5993
workspace: Add `ctrl-w x` support for vim (#42792)
Click to expand commit body
Adds support for the vim CTRL-W x keybinding, which swaps the active
pane with the next adjacent one, prioritizing column over row and next
over previous. Upon swap, the pane which was swapped with is activated
(this is the vim behavior).
See also
https://github.com/vim/vim/blob/ca6a260ef1a4b4ae94bc71c17cbabf8f12bf0f8c/runtime/doc/windows.txt#L514C1-L521C24
Release Notes:
- Added ctrl-w x keybinding in Vim mode, which swaps the active window
with the next adjacent one (aligning with Vim behavior)
**Vim behavior**
https://github.com/user-attachments/assets/435a8b52-5d1c-4d4b-964e-4f0f3c9aca31
https://github.com/user-attachments/assets/7aa40014-1eac-4cce-858f-516cd06d13f6
**Zed behavior**
https://github.com/user-attachments/assets/2431e860-4e11-45c6-a3f2-08f1a9b610c1
https://github.com/user-attachments/assets/30432d9d-5db1-4650-af30-232b1340229c
Note: There is a discrepancy where in Vim, if vertical and horizontal
splits are mixed, swapping from a column with a single window does not
work (see the vertical video), whilst in Zed it does. However, I don't
see a good reason as to why this should not be supported and would argue
that it makes more sense to keep the clear priority swap behavior,
instead of adding a workaround to supports such cases.
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Moritz Fröhlich
and
Conrad Irwin
created
04e92fb
vim: Fix :s command ignoring case sensitivity settings (#42457)
Click to expand commit body
Closes #36260
This PR fixes the vim :s Command Ignores Case Sensitivity Settings
Release Notes:
- N/A
Hans
created
e275904
Actually show settings errors on app load (#43268)
Click to expand commit body
They were previously hidden by the global settings file succeeding to
parse :face-palm:
Release Notes:
- N/A
Conrad Irwin
created
a675eb1
Fix regression in closing project diff (#43964)
Click to expand commit body
Follow-up to #43586--when the diff is not split, just render the primary
editor. Otherwise the child `Pane` intercepts `CloseActiveItem`. (This
is still a bug for the actual split diff, but just fixing the
user-visible regression for now.)
Release Notes:
- N/A
Cole Miller
created
b27ad98
zeta: Put back 15s reject debounce (#43958)
Click to expand commit body
Release Notes:
- N/A
Agus Zubiaga
created
9c4e160
extension_ci: Use more robust bash syntax for `bump_extension_version` (#43955)
Click to expand commit body
Also does some more cleanup here and there.
Release Notes:
- N/A
Finn Evers
created
34a2bfd
ci: Supply `github_token` to `bufbuild_setup_action` (#43957)
Click to expand commit body
This should hopefully resolve errors like
https://github.com/zed-industries/zed/actions/runs/19839788214/job/56845583441
Release Notes:
- N/A
bd79ede
extension_ci: Improve behavior when no Rust is present (#43953)
Click to expand commit body
Release Notes:
- N/A
Finn Evers
created
0bb1c6a
Return json value instead of empty string from accept/reject endpoints
Agus Zubiaga
created
fd14675
Add Doxygen injection into C and C++ comments (#43581)
Click to expand commit body
Release Notes:
- C/C++ files now support Doxygen grammars (if a Doxygen extension is installed).
Clément Lap
created
6eb9f9a
Debug a test annotated with the ignore attribute if the test name partially matches another test (#43110)
Click to expand commit body
Related: #42574
If an integration test is annotated with the ignore attribute, allow the
"debug: Test" option of the debug scenario or Code Action to run with
the "--include-ignored" and "--exact" arguments. Inclusion of "--exact"
covers the case where more that one test shares a base name. For
example, consider two tests named "test_no_ace_in_middle_of_straight"
and "test_no_ace_in_middle_of_straight_flush." Without the "--exact"
argument both tests would run if a user attempts to debug
"test_no_ace_in_middle_of_straight".
Release Notes:
- Improved "debug test" experience in Rust with ignored tests.
1535e95
ci: Always run nextest for extensions (#43945)
Click to expand commit body
This makes rolling this out across extensions a far bit easier and also
safer, because we don't have to manually set `run_tests` for every
extension (and never have to consider this when updating these).
Release Notes:
- N/A
Finn Evers
created
26f7703
edit prediction: Do not attempt to gather context for non-zeta2 models (#43943)
Click to expand commit body
We were running the LLM-based context gathering for zeta1 and sweep
which don't use it.
Release Notes:
- N/A
We were allowing the client to build up to
`MAX_EDIT_PREDICTION_REJECTIONS_PER_REQUEST`. We'll now attempt to flush
the rejections when we reach half max.
Release Notes:
- N/A
Agus Zubiaga
created
58c9cba
git_ui: Clean up file history view design (#43941)
Click to expand commit body
Mostly cleaning up the UI code. The UI looks fairly the same just a bit
more polished, with proper colors and spacing. Also added a scrollbar in
there. Next step would be to make it keyboard navigable.
<img width="500" height="1948" alt="Screenshot 2025-12-01 at 5 38@2x"
src="https://github.com/user-attachments/assets/c266b97c-4a79-4a0e-8e78-2f1ed1ba495f"
/>
Release Notes:
- N/A
Danilo Leal
created
7881551
ci: Request GitHub token for proper repository (#43940)
Click to expand commit body
Release Notes:
- N/A
Finn Evers
created
ff6bd7d
sweep: Add UI for setting Sweep API token in system keychain (#43502)
While this does work for PRs and such, it does not work with main...
Hence, moving the token a few chars to the right to fix this issue.
Release Notes:
- N/A
- Updates tone to match bug template
- Removes the "current vs expected" behavior section
- It doesn't feel very useful. Users expect Zed to not crash, regardless
of what they are doing.
Release Notes:
- N/A
Joseph T. Lyons
created
33ecb0a
Clarify how outlining works in read_file_tool description (#43929)
Click to expand commit body
<img width="698" height="218" alt="Screenshot 2025-12-01 at 1 27 02 PM"
src="https://github.com/user-attachments/assets/a5d9e121-4e68-40d0-a346-4dd39e77233b"
/>
Closes #419
Release Notes:
- Revise tool call description for read file tool to explain outlining
behavior
Richard Feldman
created
7b7ddbd
Adjust edit prediction upsell copy and animation (#43931)
c8166ab
Add more workflows for extension repositories (#43924)
Click to expand commit body
This PR adds workflows to be used for CD in extension reposiories in the
`zed-extensions` organization and updates some of the existing ones with
minor improvemts.
Release Notes:
- N/A
Finn Evers
created
628c52a
buffer: Keep the shorter language setting names for the common operation (#43915)
Click to expand commit body
cc
https://github.com/zed-industries/zed/pull/43888#issuecomment-3597265087
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Lukas Wirth
created
4655366
git: Push process spawns to the background threads (#43918)
Click to expand commit body
Release Notes:
- Improved performance of multibuffers by spawning git blame processes
on the background threads
89841d0
Suppress a backtrace in extension error logging (#43917)
Click to expand commit body
One less redundant backtrace in the logs:
<img width="2032" height="1161" alt="backtrace"
src="https://github.com/user-attachments/assets/f03192b4-1b9c-4fa1-809d-9e826452f711"
/>
Release Notes:
- N/A
Kirill Bulatov
created
7aa610e
Run the unit evals cron in a matrix (#43907)
Click to expand commit body
For now, just using Sonnet 4.5 and Opus 4.5 - I'll make a separate PR
for non-Anthropic models, in case they introduce new failures.
Release Notes:
- N/A
60312a3
Fix attach to process in Go debugger (#43898)
Click to expand commit body
Release Notes:
- Fixed the behavior of the attach to process feature for the Golang
debugger.
**Step to reprorduce:**
1. Build and run golang binary
2. In Zed open debugger
3. Go to Attach tab
4. Select the binary you just built from the list
**Actual result:**
```
Tried to launch debugger with: {
"request": "attach",
"mode": "debug",
"processId": 74702,
"stopOnEntry": false,
"cwd": "/path/to/the/current/working/directory"
}
error: Failed to attach: invalid debug configuration - unsupported 'mode' attribute "debug"
```
**Expected result:** The debugger can attach to the process.
According to the [Delve
documentation](https://github.com/go-delve/delve/tree/master/Documentation/api/dap#launch-and-attach-configurations)
`attach` request supports `local` and `remote` values only
At some point, rust-analyzer started including the snippet expression
for some completions in the description field, but that can look like a
bug:
<img width="1570" height="578" alt="CleanShot 2025-11-27 at 20 39 49@2x"
src="https://github.com/user-attachments/assets/5a87c9fe-c0a8-472f-8d83-3bc9e9e00bbc"></img>
In these cases, we will now inline the tab stops as an ellipsis
character:
<img width="1544" height="428" alt="CleanShot 2025-12-01 at 10 01 18@2x"
src="https://github.com/user-attachments/assets/4c550891-4545-47cd-a295-a5eb07e78e92"></img>
You may also notice that we now syntax highlight the pattern closer to
what it looks like after accepted.
Alternatively, when the tab stop isn't just one position, it gets
highlighted as a selection since that's what it would do when accepted:
<img width="1558" height="314" alt="CleanShot 2025-12-01 at 10 04 37@2x"
src="https://github.com/user-attachments/assets/ce630ab2-da22-4072-a996-7b71ba21637d"
/>
Release Notes:
- rust: Display completion tab stops inline rather than as a raw LSP
snippet expression