62 Commits
Author SHA1 Message Date
Finn Evers 20d55798db Fix cargo shear warnings (#64340)
Also updates CI to always run this - that way we ensure that disabling
or enabling tests does not become stale at some point and thus can
safely add this.

Release Notes:

- N/A
- [GPUI] N/A
2026-09-17 08:49:31 +00:00
Alex LachanceandFinn Evers 70385163e8 python: Fix at sign decorator highlighting conflict with matrix multiplication at sign operator (#58077)
In the current Python Tree-sitter `highlight.scm`, the `@` used for
decorators (`@punctuation.special` rule) is incorrectly overridden by
the `@` used for matrix multiplication (`@operator` rule).

This PR updates the matrix multiplication highlight query so it only
applies in binary operator contexts, and it also removes a duplicate
`@punctuation.special` for the `@` decorator.

| Before | After |
|
:---------------------------------------------------------------------------------------------------------------------------------:
|
:--------------------------------------------------------------------------------------------------------------------------------:
|
| <img width="338" height="1056" alt="image"
src="https://github.com/user-attachments/assets/cdce1556-6f7d-4542-abca-bcb3e11b6629"
/>| <img width="380" height="1057" alt="image"
src="https://github.com/user-attachments/assets/f948413c-ad8a-4ccc-89c1-bbffbe2affda"
/>|


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fix Python at sign decorator highlighting conflict with matrix
multiplication at sign operator

---------

Co-authored-by: Finn Evers <finn@zed.dev>
2026-09-14 07:33:49 +00:00
5c1845ddb8 Fix language injections containing interpolations (#49265)
Release Notes:

- Fixed injected language highlighting for strings containing
interpolations

current             |  updated
:-------------------------:|:-------------------------:

![](https://github.com/user-attachments/assets/b1e609c4-f0cd-45af-9e11-abcc711a19ea)
|
![](https://github.com/user-attachments/assets/9d6eb37e-f476-4495-bcec-9792ad52d3d6)

<details>

<summary> test snippet  </summary>

```python
my_regex = r"[0-9]"
spark.sql(  # sql
    f"""
        SELECT
            col1,
            CASE WHEN col2 RLIKE '{my_regex}' THEN '1' ELSE '2' END col4,
            ROW_NUMBER() OVER(PARTITION BY col1, col2 ORDER BY col3) as rn
        FROM tbl
    """
)
```

</details>

## Summary
Strings with interpolations like `f"SELECT col1 FROM tbl WHERE col2 =
'{my_var}'"` in Python produce multiple `string_content` nodes. Without
grouping, each fragment gets its own injection layer which breaks syntax
highlighting.

This PR adds an `@injection.host` capture to group `@injection.content`
ranges by their host node. This was implemented by extending the
existing `combined_injection_ranges` hash map with a node key per host.
Added tests for this behavior covering simple strings, f-strings with
single/multiple interpolations, and multi-string isolation.

---------

Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-09 08:27:12 +00:00
Kirill Bulatovandzed-zippy[bot] 84148a0f73 Reduce LLVM IR bloat one last time (#63882)
I think this is the final attempt of mine to do anything about the
binary size, as those fixes become relatively intricate and I like them
less and less.

Each commit has its own improvement stats and mainly reduce generic-code
duplication through shared non-generic helpers and `#[inline(never)]`
boundaries.

Total reduction stats:

With sccache disabled, `cargo clean` and `cargo build --release -p zed`:
Before: zed binary 396716472 bytes
After: zed binary 359416504 bytes (-9.40%, -37.29MB)

Release Notes:

- N/A

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-09-07 15:18:49 +00:00
Jesse Cooper bfd320ca65 grammars: Highlight C23 constexpr keyword (#63833)
# Objective

- the keyword `constexpr` was added in c23, see
[here](https://en.wikipedia.org/wiki/C23_(C_standard_revision)#Constants)

## Solution

- added `constexpr` to keyword list in c

## Testing

- compiled and tested it to see `constexpr` is now highlighted

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- added `constexpr` keyword to c language
2026-09-07 00:00:29 +00:00
GamiandFinn Evers a3517499be grammars: Distinguish control-flow keyword highlighting in Go (#63769)
# Objective
- Improve Go's syntax highlighting by distinguishing control-flow
keywords from other keywords, in the same way it was done for other
languages.

## Solution

- Split keywords in `highlights.scm` into two groups: `keyword.control`
and `keyword`. This change affects tree-sitter highlighting, enabling
`Semantic Tokens` can override it.

## Testing

- Tested locally on Windows using a development build, with `Semantic
Tokens` disabled. Opened a Go file with a theme that assigns different
colors to `keyword` and `keyword.control`

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

- Screenshot showing a build without this change and one with it side by
side
<img width="930" height="154" alt="after"
src="https://github.com/user-attachments/assets/bf3f612f-0ffc-40e4-b4c3-7002fff49fb7"
/>


Release Notes:
- Improved Go syntax highlighting by separating control-flow keywords
from regular keywords

---------

Co-authored-by: Finn Evers <finn.evers@outlook.de>
2026-09-06 23:48:10 +00:00
Kirill Bulatovandzed-zippy[bot] d2b09224b3 Use proper editions (#63733)
Release Notes:

- N/A

---------

Co-authored-by: zed-zippy[bot] <234243425+zed-zippy[bot]@users.noreply.github.com>
2026-09-04 22:54:09 +00:00
Conrad IrwinandBen Kunkle 72dc742101 Support building with corgi (#63396)
[corgi](https://github.com/ConradIrwin/corgi) is a cargo-compatible
build tool that runs `build.rs` scripts and proc-macros in a sandbox (no
network, no ambient env, reads limited to a package's own `.rs` sources
unless declared). This makes Zed buildable under it. Cargo builds (dev
and release) are unaffected.

### Changes

- **`scratch` patch**: patch `scratch` to a small local copy
(`corgi-patches/scratch`) that reads `OUT_DIR` at runtime instead of
baking it in at compile time. `cxx-build` writes its shared cxxbridge
headers into `scratch::path(...)`; upstream returns a single global dir
(outside any action's `OUT_DIR`) that the sandbox can't grant, while
this patch gives each build script a private, writable dir in its own
entry. webrtc-sys is self-contained, so per-crate scratch dirs are
sufficient. Kept local rather than a cxx git fork because a git checkout
of cxx needs symlink support that Windows cargo CI lacks.
- **Dev asset loading**: add `util::dev_fs_embed!` and switch dev-mode
`rust_embed` asset sources (`assets`, `settings`, `grammars`, `agent`,
`edit_prediction_cli`) to read from the checkout at runtime, locating
the repo root by walking from the executable up to the enclosing `.git`.
This avoids baking `CARGO_MANIFEST_DIR` into the binary (corgi rejects
artifacts that embed the build-time checkout path, and it's wrong in any
other worktree). Release builds still embed via `#[derive(RustEmbed)]`.
- **Stop baking checkout paths into artifacts**: drop
`gpui::GPUI_MANIFEST_DIR`; resolve `../gpui` from `gpui_apple`'s build
script; stage the metal shader into `OUT_DIR` before compiling so the
`.metallib` records the output dir, not the checkout; resolve the repo
root at runtime in `remote` and `inspector_ui` (removing
`inspector_ui`'s `build.rs` / `ZED_REPO_DIR`).
- **corgi.toml**: declare the pinned tools (`cmake`, prebuilt libwebrtc
via `LK_CUSTOM_WEBRTC`), a release-only `ZED_COMMIT_SHA` probe, and the
non-`.rs` / cross-package reads each package performs.

### Validation

- `corgi check` + `corgi build`, dev and release, for `zed` (plus `cli`,
`remote_server`, `ep`) with a warm C++ cache — clean; built binaries
embed no checkout path.
- `corgi fmt --check`, `corgi clippy`, and `corgi test` on the changed
crates (922 tests pass).
- `cargo check -p util` locally; relying on CI for the full cargo
build/test matrix.

### Notes for the reviewer

- Per the repo rule, the first two lines of `README.md` are the
review-confirmation marker; remove them before merging (this is what
Danger is failing on).
- `remote_server` cross-compilation (linux-musl via zigbuild) is not yet
covered by `corgi.toml` — host (macOS arm64) only for now.

### Suggested .rules additions

Only if the team wants corgi guidance in `.rules` (it recurred several
times here): dev builds must not bake the checkout path into artifacts —
no `env!("CARGO_MANIFEST_DIR")` or `file!()`-derived absolute paths in
library/binary output. Resolve the repo root at runtime via
`util::dev_repo_root()` (walks to `.git`), and use `util::dev_fs_embed!`
for dev-mode `rust_embed` sources.

Release Notes:

- N/A

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
2026-08-31 17:37:00 +00:00
那思路(なしろ) a209865454 Recognize .bash_login as shell script (#63466)
Added `.bash_login` to the list of recognized shell script files for
syntax highlighting.

Shoutout: [acidx27x](https://github.com/acidx27x) for #62720

Release Notes:
- Added shell script language detection for `.bash_login` files.
2026-08-31 09:04:16 +00:00
Torbjørn LiumandFinn Evers 611301feb3 Add Python runnable for __name__ in ("__main__",) pattern (#58911)
The gutter run button for Python's main guard only appears for `if
__name__ == "__main__":` but not for the alternative membership test
pattern `if __name__ in ("__main__", "__builtin__", "builtins"):`.

This adds a second Tree-sitter query in `runnables.scm` that matches the
`in` variant. It emits the same `python-module-main-method` tag, so both
patterns get the same gutter icon and task behavior.

Self-Review Checklist:
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior (No dedicated tests for the
Python runnables queries exist. The build passes cleanly)
- [x] Performance impact has been considered and is acceptable

Closes #58909

Release Notes:

- Fixed Python run button not appearing in the gutter for `if __name__
in ("__main__", ...)` style main guards.

Co-authored-by: Finn Evers <finn@zed.dev>
2026-08-19 22:16:44 +00:00
Nguyen Anh Tu (Elior)andKirill Bulatov 9bafb64cb5 Add debugger.scm for C and C++ to enable inline values (#46705)
Closes #46522

  Release Notes:

- Added inline values support for C and C++ when debugging with CodeLLDB
or GDB

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-08-19 18:45:57 +00:00
Finn Evers e7b4a54c53 language_core: Represent supported queries using an enum (#62707)
Refactors our query loading to instead have an enum of supported queries
and load the query files themselves in parallel, where possible.

We will use this to warn extension authors when unsupported queries are
present, as we no longer want to ship those as part of the extension.

It also now enforces one file per supported query - only one extension
currently utilizes this feature and was undocumented previously, so I
decided in favor of removing it here, since this will help with
enforcing extensions to just ship query files we actually support in the
future. The extension has also been migrated so that it does not break
with this effort

Side-effect of this change is that we now load both embedded and
external languages up to at least 10%/5% faster, since the files are now
read in parallel as opposed to sequentially one by one.

Release Notes:

- N/A
2026-08-19 16:26:14 +00:00
kirim 9093ccd5d5 Recognize .brushrc files as shell scripts (#62720)
Add `.brushrc` to the Shell Script language configuration so
[Brush](https://github.com/reubeno/brush) shell configuration files
receive shell syntax highlighting.

Release Notes:
- Added Shell Script language detection for `.brushrc` files.
2026-08-17 00:36:13 +00:00
Alex Lachance 21ffa9d8ce python: Add dunder variables highlighting (#58158)
In the current Python Tree-sitter `highlights.scm`, dunder variables
(e.g., `__name__`, `__file__`) are not highlighted.

This PR adds a regex `#match?` so all dunder variables are highlighted
under `@attribute.special`.

An alternative solution would be to use `#any-of?` and list all dunder
variables.


| Before | After |
|
:---------------------------------------------------------------------------------------------------------------------------------:
|
:--------------------------------------------------------------------------------------------------------------------------------:
|
|<img width="623" height="895" alt="image"
src="https://github.com/user-attachments/assets/ad7b67ba-541c-40ac-a38a-cc863e417fcc"
/> | <img width="612" height="903" alt="image"
src="https://github.com/user-attachments/assets/a91f5efb-230a-4214-b16b-04278b3ef9ee"
/>|


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added Python dunder variables highlighting via `attribute.special` in
themes.
2026-08-06 15:29:26 +00:00
Ibrahim Khan e476383ca8 grammars: Highlight class instantiations in JavaScript, TypeScript, and TSX (#61890)
## Why

JavaScript, TypeScript, and TSX class declarations were captured as
`type.class`, but the same class names in `new` expressions were
captured as the generic `type`. Themes that define a distinct style for
`type.class` therefore rendered declarations and instantiations
inconsistently.

## What

Update the three highlight queries so constructor identifiers in `new`
expressions use `type.class`. Themes without a dedicated `type.class`
style continue to fall back to their existing `type` style.

Add a regression test that loads the real JavaScript, TypeScript, and
TSX grammars with distinct colors for `type` and `type.class`, then
verifies that both the declaration and instantiation receive the
class-specific highlight.

## Testing

- `cargo test -p languages test_class_instantiation_highlighting`
- `cargo test -p languages`
- `cargo fmt --all -- --check`
- `./script/clippy -p languages`

## References

Closes #55943

Release Notes:

- Fixed inconsistent class instantiation highlighting in JavaScript,
TypeScript, and TSX.
2026-07-30 21:16:10 +00:00
Kunall BanerjeeandMrSubidubi 66c0db4d3c grammars: Support linked editing of custom elements in JSX and TSX (#58578)
JSX and TSX only treated the dot as a tag-name character during
linked-editing, so renaming a tag to a custom element name such as
`custom-el` stopped mirroring the closing tag at the dash.

A follow-up to https://github.com/zed-industries/zed/pull/43179, really.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #58553.

Release Notes:

- Added support for linked-editing of custom elements in JSX/TSX

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-07-29 21:23:53 +00:00
Kunall BanerjeeandMrSubidubi f4faad1aba grammars: Enable Emmet completions in return and arrow function bodies (#53688)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #52205.

Release Notes:

- Enabled Emmet completions in return and arrow function bodies for
JSX/TSX

---------

Co-authored-by: MrSubidubi <finn@zed.dev>
2026-07-29 21:07:33 +00:00
Lee ByeongJunanddino 32adc59cb7 Surround selection with backticks in Rust, C, and C++ comments (#58674)
Typing a backtick over selected text in Rust, C, and C++ comments
replaced the selection instead of wrapping it. Markdown already supports
this via its backtick bracket pair.

Add a backtick bracket pair for these languages:
  - `surround = true` wraps selections in backticks
  - `close = false` avoids auto-closing lone backticks
  - `not_in = ["string"]` enables it in comments but not strings

Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [X] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [X] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

Closes #58538

Release Notes:

- Added support for surrounding selected text with backticks in Rust, C,
and C++

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-07-21 11:27:16 +00:00
Finn Eitreim ced39bbd9f markdown: Fix inline HTML block highlighting (#61212)
# Objective

Fixes #59304

Right now inline html tags don't render with any kind of highlighting,
despite the fact that non-inline html tags do get highlighting.

## Solution

Right now zed already has tree-sitter rules that identifies the inline
blocks so we can add a new tree-sitter grammar rule,
```
((html_tag) @injection.content
  (#set! injection.language "html")
  (#set! injection.combined))
```
that passes these blocks to the html language server.

## Testing

I did some manual testing:


https://github.com/user-attachments/assets/92e5b322-bbc1-48c3-a615-0d32acc2e7d6

And also added a test:
test_markdown_inline_html_highlighting


## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

---

Release Notes:

- markdown: Fixed inline html block highlighting.
2026-07-20 03:52:32 +00:00
Apoorva VermaandNathan Sobo 749bd0d29f Fix auto-indent for braceless if/for/while in TypeScript (#60708)
type `if (true)`, hit enter, nothing indents. same for for/while.

5705919 commented these out to stop allman braces over-indenting
(#24976). fixed that, broke this. put them back with an optional `@end`
on the `{}` body so braced blocks stop before the brace and braceless
ones indent. same in tsx.

Fixes #60371.

Release Notes:

- Fixed TypeScript and TSX not auto-indenting the body of a braceless
`if`, `for`, or `while`

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
2026-07-15 23:29:16 +00:00
Lukas Wirth 4896f7f10c Thin out unnecessary dependencies from core crates (#60977)
Release Notes:

- N/A or Added/Fixed/Improved ...
2026-07-14 15:02:41 +00:00
byteoxo 501975d322 Recognize deno.lock as JSON (#60679)
Reasons: Deno officially states that the deno.lock file is of JSON type.

https://github.com/denoland/vscode_deno/blob/main/schemas/lockfile.schema.json

Release Notes:

- Added JSON language support for `deno.lock` files.
2026-07-14 08:42:25 +00:00
Apoorva Verma 5f28f58f9f Indent statements under C/C++ case labels (#60758)
# Objective

Fixes #60261

Nothing under a `case` gets indented in C or C++, and the next `case`
doesn't come back out. It stays flat until you hit `editor: format`.

## Solution

The indent queries had no rule for case labels. Added the same pair
`cpp/indents.scm` uses for `access_specifier`: open an indent range at
the label, close it at the switch's `}`, outdent on the next label.

The part that got me: `@start` uses the *end* of the node you capture.
Fine for `access_specifier`, which is just `public:`. But a
`case_statement` swallows the statements under it, so capturing the node
starts the range after the last one. Capture the `:` instead. `default:`
is a `case_statement` too, so it comes along free.

Only affects what happens after a label, so existing `case` alignment
doesn't move.

## Testing

`test_c_autoindent_switch_case` and `test_cpp_autoindent_switch_case`
cover a plain case, fall-through labels and `default`. Both fail on
main. The `access_specifier` tests still pass.

Not mine, but worth knowing: `typescript::tests::test_outline` and
`test_generator_function_outline` are flaky on main, failing about half
my full `cargo test -p languages --lib` runs with or without this
change.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed statements under a `case` label not being indented in C and C++
([#60261](https://github.com/zed-industries/zed/issues/60261)).
2026-07-12 23:02:26 +00:00
feeiyu 269e1c3fd5 Improve JS/TS/TSX parameter highlighting for destructuring (#60767)
# Objective

Fixes #51967

Destructured JS/TS/TSX parameters with defaults were not highlighted
consistently as parameters when using themes that distinguish arguments
from variables/properties, such as Catppuccin.

For example, in:

```js
function a({ argument = true }) {}
```

`argument` was parsed under a default assignment pattern and did not
receive the same `@variable.parameter` capture as a destructured
parameter without a default.

This also affected array binding patterns with defaults, such as:

```js
function b([argument = true]) {}
```

## Solution

Updated the JS/TS/TSX highlight queries to capture destructured
parameters with default values as `@variable.parameter`.

This covers both:

- Object binding patterns with defaults, such as `{ argument = true }`
- Array binding patterns with defaults, such as `[argument = true]`

As a result, destructured parameters are highlighted consistently
whether or not they provide a default value.

## Testing

- Verified the highlight query changes for JavaScript/TypeScript
destructured parameters with defaults.
- Tested examples include:
    ```js
    function a({ argument }) {}
    function a({ argument = true }) {}
    function a({ argument = true }?) {} //optional
    function b([argument]) {}
    function b([argument = true]) {}
    function b([argument = true]?) {} // optional
    ```
- These cases should be easiest to visually confirm with a theme that
distinguishes parameters from variables/properties, such as Catppuccin.

## Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [X] Unsafe blocks (if any) have justifying comments
- [X] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

## Showcase

Before this change, 
<img width="1600" height="332" alt="图片"
src="https://github.com/user-attachments/assets/fbacb22b-f0e4-490d-8f94-6059e66d3ae0"
/>

After this change:
<img width="1599" height="353" alt="图片"
src="https://github.com/user-attachments/assets/3eae692b-391e-4c53-9925-1ca2f5774038"
/>


Release Notes:

- Fixed inconsistent syntax highlighting for JS/TS/TSX destructured
parameters with default values.
2026-07-12 22:29:35 +00:00
Sergey Borovikov ffaa1b9379 javascript, typescript: Inject GLSL and WGSL syntax in comment-labeled template literals (#55341)
Extends the existing ECMAScript comment-label injection system to
support GLSL and WGSL shader languages inside JS/TS strings and template
literals.

The pattern `/* language */` before a string is already used for `html`,
`sql`, `graphql`, and `css`. This adds the same support for two shader
languages commonly embedded as strings in WebGL/WebGPU code:

before:
<img width="460" height="300" alt="Screenshot 2026-04-30 at 23 07 05"
src="https://github.com/user-attachments/assets/8952eddc-2f53-42ea-b086-7a0b63dceb10"
/>

after:
<img width="460" height="300" alt="Screenshot 2026-04-30 at 23 07 39"
src="https://github.com/user-attachments/assets/93bf536a-9df4-438b-af7b-382efda196ca"
/>

Syntax highlighting activates when the corresponding extension is
installed:
- GLSL: the built-in `glsl` extension
- WGSL: the community extension
[`wgsl-wesl-zed`](https://github.com/lucascompython/wgsl-wesl-zed)
(language name `WGSL/WESL`)

Both `/*glsl*/` and `/* glsl */` forms are accepted (same behavior as
the existing patterns).

Release Notes:

- Added `/*glsl*/` and `/*wgsl*/` comment-label syntax injection for
JavaScript and TypeScript template literals
2026-07-10 11:45:13 +00:00
Michael EggerandKirill Bulatov ce9720d61b grammars: Recognize Gentoo ebuild files as bash script (#59068)
The Gentoo `ebuild` file format is a subset of a bash script, see
https://wiki.gentoo.org/wiki/Ebuild.


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Changed `ebuild` files to be recognized as bash.

Signed-off-by: gcarq <egger.m@protonmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-07-08 12:36:29 +00:00
olegator888andKirill Bulatov eb9b2b8341 go: Fix outline for methods with unnamed receivers (#58656)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

This fixes Go outline extraction for methods whose receiver has no name,
such as `func (v2) Method()`. These methods are now included in outline
symbols, which also feed breadcrumbs and sticky
scroll.

Tested with:

- `cargo test -p languages`
- `cargo test -p grammars`
- `./script/clippy -p languages`
- `cargo fmt --check --package languages`

Before:

[before_cut.webm](https://github.com/user-attachments/assets/91eb5cb0-703a-4496-b0dd-5369c4c219fc)

After:

[after_cut.webm](https://github.com/user-attachments/assets/76d13d88-3671-4118-99fc-c073a6e64727)

Release Notes:

- Fixed Go methods with unnamed receivers not appearing in breadcrumbs
and sticky scroll.

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-07-08 12:21:46 +00:00
( Nechiforel David-Samuel ) NsdHSOandKirill Bulatov d24ce6b98d grammars: Fix runnable gutter detection for describe.skipIf / test.skipIf in JS/TS/TSX (#60153)
I came across issue #60149 and wanted to help. The runnable gutter (play
button) was not showing for Vitest's conditional test wrappers like
it.skipIf(condition) and it.runIf(condition).
<img width="905" height="395" alt="image"
src="https://github.com/user-attachments/assets/7386ae4c-f2e6-4fe8-9e33-674d6821d3fa"
/>
<img width="972" height="787" alt="image"
src="https://github.com/user-attachments/assets/c7c55bb2-ed50-4ce0-ae31-af341ab9eb3a"
/>
<img width="167" height="488" alt="image"
src="https://github.com/user-attachments/assets/75e07913-390e-4674-a5fb-7113ffd1fa85"
/>

Closes #60149 

Release Notes:

- Fixed runnable gutter detection for Vitest conditional test wrappers
(skipIf/runIf) in JS/TS/TSX files

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-07-01 17:36:57 +00:00
sollniss c76594af82 go: Highlight predeclared types and built-in functions (#59780)
Tag Go's universe-scope identifiers as @type.builtin and
@function.builtin, matching Rust, TypeScript, and Python grammars (and
upstream tree-sitter-go / nvim-treesitter / Helix). Themes already style
these captures, so Go was the only major language not distinguishing
built-ins.

# Objective

Adds support for `@type.builtin` and `@function.builtin` targeted syntax
highlighting.

## Solution

Defined builtin functions and types in Go's highlights.scm.

## Testing

All screenshots are with `"semantic_tokens": "off"`. Built with
`--release` flag.

Before
<img width="591" height="619" alt="Screenshot_2026-06-24_03-15-56"
src="https://github.com/user-attachments/assets/996e48a0-4e46-45fa-a8fd-ff64820e58ac"
/>

<img width="591" height="619" alt="Screenshot_2026-06-24_03-15-11"
src="https://github.com/user-attachments/assets/b875c02b-80eb-4a4c-b9df-341ffd29ee5c"
/>

After

<img width="591" height="650" alt="Screenshot_2026-06-24_03-17-08"
src="https://github.com/user-attachments/assets/fca72a77-6359-4bb5-916e-a2e6e8b5c539"
/>

<img width="591" height="650" alt="Screenshot_2026-06-24_03-17-44"
src="https://github.com/user-attachments/assets/48a983ec-743c-4edc-abf3-915a759b2b23"
/>

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- go: Add support for highlighting builtin types and functions
2026-06-25 11:03:44 +00:00
Xin Zhao d2e52d12e1 grammars: Add semantic token rule for Python constants (#59811)
# Objective

In Python, using variables in all uppercase letters signals that the
variable is a constant. In Zed's built-in Python grammar, this
convention is respected. Similarly, the `ty` language server has a rule
for this:


https://github.com/astral-sh/ruff/blob/e39ded7e89f503d892217364f924b38362fb9a66/crates/ty_ide/src/semantic_tokens.rs#L264-L267


https://github.com/astral-sh/ruff/blob/e39ded7e89f503d892217364f924b38362fb9a66/crates/ty_ide/src/semantic_tokens.rs#L356-L358

It returns a `"readonly"` token modifier if an item is determined to be
a constant. However, this specific modifier is not currently respected
in Zed. Consequently, when using `ty` as the language server (which is
expected to be a common setup in the near future, similar to `ruff` and
`uv`), and enable semantic token highlighting, these constants are
highlighted as normal variables.

## Solution

- Added a new semantic token rule in
`crates/grammars/src/python/semantic_token_rules.json` to provide
highlighting for constants.

## Testing

- This change primarily affects the UI and has been tested locally. A
before-and-after comparison is provided below in the Showcase section.

## Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content adheres to Zed's UI standards
([UX/UI](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
and
[icon](https://github.com/zed-industries/zed/blob/main/crates/icons/README.md)
guidelines)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Showcase

<details>
  <summary>Click to view showcase</summary>

| Before | After |
| :---: | :---: |
| <img width="441" height="208" alt="highlight_before"
src="https://github.com/user-attachments/assets/64cc28ba-32b6-4620-a212-8f7d43f54821"
/> | <img width="441" height="208" alt="highlight_after"
src="https://github.com/user-attachments/assets/133919fd-03c8-4f6c-9bf9-9efa2610f050"
/> |
| <img width="498" height="145" alt="highlight_tree_before"
src="https://github.com/user-attachments/assets/b79f4036-65e4-4e4e-b0e9-e653529e114d"
/> | <img width="498" height="145" alt="highlight_tree_after"
src="https://github.com/user-attachments/assets/e0c3ae74-46b4-4d06-895b-51da69d410c5"
/> |
</details>

---

Release Notes:

- Improved semantic highlighting for Python constants when using the
`ty` language server.
2026-06-24 15:37:58 +00:00
Helmer NordströmandChristopher Biscardi 331c5608e3 Fix indentations for expressions in C/C++ (#58740)
Indentations are not correctly handled for expressions in C/C++. To fix
this i have updated indents.scm for both C/C++, there could be more
languages which have this problem but i have only noticed it in these
languages.

Current indentation behaviour:


https://github.com/user-attachments/assets/2804d3a6-2dde-484b-b1f4-0a867801bc0c

Expected indentation behaviour:


https://github.com/user-attachments/assets/b1ebe840-7391-4f5d-bfe0-87d413f5dfe2

Release Notes:

- Improved indentation for C/C++ to be more consistent.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-06-09 03:12:17 +00:00
Alex Lachance 0e081b096a python: Fix Python exception highlighting (#58176)
In the current Python Tree-sitter `highlights.scm`, exception
(https://docs.python.org/3/library/exceptions.html) are highlighted
under `@type.class` which is inconsistent compared to other editors (VS
Code, Neovim, Helix).

This PR adds `#any-of?` with a list of python's exceptions and highlight
them under `@type.builtin`.

| Before | After |
|
:---------------------------------------------------------------------------------------------------------------------------------:
|
:--------------------------------------------------------------------------------------------------------------------------------:
|
| <img width="1237" height="1160" alt="image"
src="https://github.com/user-attachments/assets/05e1ae34-7637-413a-9785-ad696c2bf751"
/> | <img width="1237" height="1154" alt="image"
src="https://github.com/user-attachments/assets/105c61ca-b6a7-4c26-acc8-3e300f044510"
/> |


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Added the ability to stylize builtin python exceptions and warnings
using the `type.class.builtin` syntax capture.
2026-06-05 22:49:28 +00:00
Justin SuandYara 🏳️‍⚧️ b45344df51 Add envrc to Shell Script path_suffixes (#58573)
direnv's .envrc files are just Bash scripts.

---

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Release Notes:

- Detect .envrc files as Shell Script

Co-authored-by: Yara 🏳️‍⚧️ <git@yara.blue>
2026-06-05 09:17:31 +00:00
Joseph T. Lyons 4d4890012c Add auto-surround support for tilde in Markdown (#58614)
This enables you to easily add strikethroughs to text you have selected
by typing `~` twice.
This matches VS Code's behavior.

Self-Review Checklist:

- [X] I've reviewed my own diff for quality, security, and reliability
- [X] Unsafe blocks (if any) have justifying comments
- [X] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [X] Performance impact has been considered and is acceptable

Release Notes:

- Added support for surrounding selected Markdown text with `~` by
typing `~`
2026-06-05 03:26:15 +00:00
Kunall Banerjee 5b864275f2 grammars: Stop treating fish modelines as Shell Script (#58550)
Bash listed `fish` in `modeline_aliases`, so a `filetype=fish` modeline
resolved to Shell Script before the real [Fish
language](https://zed.dev/extensions/fish) could match by name or
grammar. Fish is intentionally non-POSIX, so the Bash grammar is the
wrong fit here.

| Header | After |
|--------|--------|
| <img width="1912" height="1237" alt="image"
src="https://github.com/user-attachments/assets/ed212a24-92aa-4ede-a432-47c6c6724f08"
/> | <img width="1732" height="1125" alt="image"
src="https://github.com/user-attachments/assets/934140b3-9473-4cca-a3e5-84aa3c4d827a"
/> |

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Closes #58532.

Release Notes:

- Dropped `fish` from `modeline_aliases` which forced the file to be
detected as Shell Script instead of Fish
2026-06-04 21:48:52 +00:00
Smit Barmase 3d241b0e7b go: Fix table test detection in large files (#57277)
Closes #46881

Depends on #57276.

Implements `GoRunnableResolver` to post-process table test matches. The
resolver picks the correct string field by comparing against the field
used in `t.Run(tc.<field>, ...)`.

Release Notes:

- Fixed Go table tests not showing run buttons in files with many test
cases.
2026-06-03 10:53:22 +00:00
Ville Skyttä 64ab35c4b6 Recognize shell-script as shell in modelines (#58124)
shell-script-mode is a valid and commonly used alias for sh-mode in
Emacs.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [ ] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes N/A

Release Notes:

- Added support for `shell-script` filetype in Vim modelines
2026-06-01 19:33:21 +00:00
Alex Lachance 09d5743f6d python: Fix splat parameter highlighting (#58136)
In the current Python Tree-sitter `highlights.scm`, splat parameters
(e.g., `*args`, `**kwargs`) and typed splat parameters are not
highlighted as `@variable.parameter` due to missing patterns.

This PR adds `list_splat_pattern` and `dictionary_splat_pattern` to the
function parameter rules so splat parameters are correctly colored.

| Before | After |
|
:---------------------------------------------------------------------------------------------------------------------------------:
|
:--------------------------------------------------------------------------------------------------------------------------------:
|
| <img width="688" height="482" alt="image"
src="https://github.com/user-attachments/assets/dbb04e09-51a2-401a-8239-d244a01a02f9"
/> | <img width="686" height="480" alt="image"
src="https://github.com/user-attachments/assets/f07518ec-30fd-4067-b59d-e090da8182c3"
/> |


Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed Python splat parameters highlighting
2026-06-01 15:07:09 +00:00
Xin Zhao f86e4fe63d python: Sync built-in highlights with Python 3.15 (#57562)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

This PR updates the Python built-in functions and types in Zed's syntax
highlighting query to align with the official Python 3.15 documentation.
It also backports a few missing built-ins from earlier Python versions.

**Things added**:
- Added the newly introduced
[`sentinel`](https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-sentinel)
built-in function.
- Added the new
[`frozendict`](https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-frozendict)
built-in type.
- Added `aiter` and `anext` (originally introduced in Python 3.10) to
ensure the built-ins list is complete.

With this change, Zed's built-in function list is now fully aligned with
the latest [Built-in functions in
Python](https://docs.python.org/3.15/library/functions.html).

To note, Python 3.15 introduces a new [`lazy`
keyword](https://docs.python.org/3.15/whatsnew/3.15.html#whatsnew315-lazy-imports)
for explicit lazy imports. Fully supporting this requires upstream
changes in `tree-sitter-python` (tracked in
tree-sitter/tree-sitter-python#336). Therefore, support for the `lazy`
keyword is not included in this PR.

| Before | After |
| :---: | :---: |
| <img width="512" height="182" alt="before"
src="https://github.com/user-attachments/assets/d96b9128-61f3-422b-a7e0-fdb87d547474"
/> | <img width="569" height="219" alt="after"
src="https://github.com/user-attachments/assets/82702fbe-e423-47cb-9e88-d665c17be2e5"
/> |



Release Notes:

- Improved Python highlighting for built-in functions and types
2026-06-01 06:36:32 +00:00
saberoueslati e1961c6691 Fix json! empty-string highlighting in Rust (#55126)
## Context

This fixes incorrect syntax highlighting inside Rust `json!` macros when
a JSON value is an empty string. In the current Rust tree-sitter
injection setup, most macro bodies are reparsed as nested Rust, which
works for macros like `vec!` but breaks down for JSON-shaped `json!({
... })` content. When the nested Rust parse loses sync at `""`, later
values can inherit incorrect highlighting.

Closes #54838

The fix treats `json!` as an exception to the generic nested-Rust macro
injection rule. That keeps the outer Rust layer responsible for
token-level highlighting inside the macro body, which is enough to
correctly color JSON keys, string values, and booleans without
introducing a brittle JSON-specific injection for Rust token trees.

Manual test after the fix below :

[Screencast from 2026-04-29
00-53-01.webm](https://github.com/user-attachments/assets/26453acf-1d72-4a97-9969-3f8e236dc0cd)

## How to Review

- `crates/grammars/src/rust/injections.scm`: Start here. This is the
functional fix. The generic Rust macro injection rule now excludes
`json`, so `json!` and `serde_json::json!` bodies are no longer reparsed
as nested Rust. Existing special cases like `view!`, `html!`, `sql!`,
and regex-related behavior are left unchanged.

- `crates/language/src/syntax_map/syntax_map_tests.rs`: This adds a
regression test covering the reported case. It verifies that an empty
string inside `serde_json::json!({ ... })` does not break subsequent
highlighting, and that the expected string and boolean captures still
appear for the later JSON entries.

## Self-Review Checklist

- [x] I've reviewed my own diff for quality, security, and reliability
- [ ] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the UI/UX checklist
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed incorrect Rust syntax highlighting after empty string values
inside `json!` macros.
2026-05-31 18:42:00 +00:00
Young 169b07f7ea Recognize HIP files as C++ (#57333)
Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments (I am not adding
new unsafe blocks)
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior (Should I add a test for
this?)
- [x] Performance impact has been considered and is acceptable

Closes #ISSUE

Release Notes:

- Added Recognizing HIP files as C++
2026-05-26 16:22:19 +00:00
liam b56cf1a352 grammars: Highlight markdown code spans in tables (#57506)
Resolves https://github.com/zed-industries/zed/issues/57501

This diff fixes Markdown inline syntax highlighting inside pipe table
cells. The block Markdown parser represents table content as
`pipe_table_cell` nodes rather than `inline` nodes, so Zed’s existing
`markdown-inline` injection ran for paragraph text but skipped code
spans inside tables.

With this change, table cells also inject `markdown-inline`, allowing
existing inline highlighting to handle code spans consistently between
paragraph text and table cells.

| Before | After |
| --- | --- |
| <img width="500" alt="Before screenshot"
src="https://github.com/user-attachments/assets/bdb75c18-9f20-4f3c-bea6-946194098db6"
/> | <img width="500" alt="After screenshot"
src="https://github.com/user-attachments/assets/23ae7bc5-5208-4dc7-ab6f-d07404aeae06"
/> |

Release Notes:

- Fixed Markdown inline code highlighting in table cells.
2026-05-22 22:40:13 +00:00
Helmer Nordström ebf8c5acc2 grammars: Add runnables.scm for C++ (#57161)
Added a runnables.scm for cpp grammar so that tasks can be made with the
play button. It is already implemented for C.
2026-05-19 22:03:01 +00:00
Hadley99 99bd0701cd languages: Exclude angle brackets from rainbow bracket colorization for Javascript (#57063)
## Summary

Extends #51311 to JSX in JavaScript files, which uses the same
javascript grammar for both .js and .jsx.

## Changes

- Added (#set! rainbow.exclude) to the three angle bracket patterns in
crates/grammars/src/javascript/brackets.scm, matching the TSX fix in
#51311.

## Before / After

Before: angle brackets in JSX tags receive rainbow colors alongside
`{}`, `()`, `[]`, making every tag visually noisy.

After: only `{}`, `()`, and `[]` receive rainbow colors — angle brackets
are excluded, matching the HTML extension behavior.

Release Notes:

- Fixed angled brackets being included in rainbow bracket highlights for
JavaScript.
2026-05-18 15:54:51 +00:00
Cole McAnelly b581436dbc Revert: "languages: Improve function parameter highlighting for Bash" (#52245)
## Context

<!-- What does this PR do, and why? How is it expected to impact users?
     Not just what changed, but what motivated it and why this approach.

Link to Linear issue (e.g., ENG-123) or GitHub issue (e.g., Closes #456)
     if one exists — helps with traceability. -->

Closes https://github.com/zed-industries/zed/issues/52242

This PR reverts a change that highlights shell script arguments as
variables rather than strings. Because of how shell scripts work, all
parameters are strings by default and are regularly represented as such.
The original PR (https://github.com/zed-industries/zed/pull/48067) aimed
to improve highlighting by capturing all arguments as
`variable.parameter`s, but this doesn't align with the idiomatic usage
of shell scripts.

| Current Behavior | Expected Behavior |
|---|---|
| <img width="242" height="84" alt="Image"
src="https://github.com/user-attachments/assets/50c87198-e4be-4627-a742-88060b2b9d14"
/> | <img width="227" height="83" alt="Image"
src="https://github.com/user-attachments/assets/f08b1c62-9c7a-460e-b306-4ac6b9e5a897"
/> |
| Text arguments are highlighted as variable | Text arguments are
highlighted as "string" |

## Self-Review Checklist

<!-- Check before requesting review: -->
- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [ ] Tests cover the new/changed behavior
- [ ] Performance impact has been considered and is acceptable

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-14 16:22:49 +00:00
liam a4cf5aa29e Highlight bash conditionals and arithmetic operators (#56484)
Resolves https://github.com/zed-industries/zed/issues/56478

This diff fixes Bash syntax highlighting for conditional and arithmetic
expressions. The Bash parser already recognizes tokens like `[[`, `]]`,
`((`, `))`, `$((`, `!=`, and `||`, but Zed’s Bash highlight query was
not capturing several of them.

With this change, the Bash highlight query styles those operators and
delimiters consistently with existing shell operators, brackets, and
special punctuation.

| Before | After |
| --- | --- |
| <img width="1667" height="1088" alt="ayu-old"
src="https://github.com/user-attachments/assets/0a89bd71-0a13-4ebe-8bc9-abc27ab42ed8"
/> | <img width="1667" height="1088" alt="ayu-new"
src="https://github.com/user-attachments/assets/afa5e8ab-f94a-4f5e-8fe8-770bac07559a"
/> |

Release Notes:
- Fixed bash syntax highlighting for conditional expressions, arithmetic
expressions, and related operators.
2026-05-14 16:17:52 +00:00
Sakethanddino bb47d90c76 Highlight nested JSX member expression tags (#53750)
The highlight queries only matched JSX member-expression tags when the
object was a plain identifier (`<A.B>`), so tags with more than one dot
like `<A.B.C>` lost their component-tag highlighting.

The fix explicitly captures every leaf `identifier` and
`property_identifier` at each nesting depth (up to 3 levels) in the
JavaScript and TSX highlight queries so each token gets its own
`@tag.component.jsx` capture that beats the generic `@property` rule.

A more concise approach, capturing the whole nested
`(member_expression)` node as a single `@tag.component.jsx` blob, does
not work because the generic `(property_identifier) @property` rule
targets a smaller, more specific node inside the blob, winning the
resolution for inner segments like `B` in `<A.B.C>`. 

Closes #53305 

Release Notes:

- Fixed highlighting for nested JSX member expression tags in JavaScript
and TSX files.

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
2026-04-24 08:45:47 +00:00
Finn EversandDanilo Leal c49ffd1e88 Fix bad GitHub merge queue merge (#54721)
No, sadly, the title is not a typo. See
https://www.githubstatus.com/incidents/zsg1lk7w13cf for the context.
I'll read with joy and popcorn through that root cause analysis.

It makes literally zero sense what happened here, but for some completly
bonkers reason GitHub completely messed up the merge queue with
https://github.com/zed-industries/zed/pull/54632.

I have no idea how it happened. It makes literally zero sense. A PR
going into the merge queue should have the same LoC when getting out of
it. GitHub obviously does not check this. GitHub causes extra work with
a feature that is supposed to save time.

Thanks, I guess.

Release Notes:

- N/A

---------

Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
2026-04-23 23:47:30 +00:00
Danilo Leal 184e1d93e3 branch_picker: Add button to filter remote branches (#54632)
This PR brings back the button to filter remote branches when accessing
the title bar's branch picker with the mouse. It was unintentionally
removed when we introduced the new worktree picker.

Release Notes:

- N/A
2026-04-23 18:26:44 +00:00
Phillip Davis 9975c75cd3 languages: Fix broken whitespace for C++ (#53709)
Uses tree-sitter indent queries to create a pseudo-scope, since access
modifiers are single-node in thetree-sitter grammar.

The @outdent capture truncates the parent { } indent range at the access
specifier, keeping it at the same level as the class keyword and the
pseudo-scopes from stacking.

The @outdent range selects siblings so we don't outdent the access
specifiers themselves, since screenshots from the reference issue seem
to show that at least one interested party does not prefer outdented
access modifiers, and also it seemed like less of a departure from
existing design.

Also, there are probably more tests than needed because this is my first
time writing treesitter queries and I wanted to triple-guess myself.
Quite open too feedback on which ones are more valuable.

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Closes #53175

Release Notes:

- Improves handling of indentation after C++ access modifiers
2026-04-23 12:50:09 +00:00