Commit graph

949 commits

Author SHA1 Message Date
Ben Brandt
2a00db06ce
node_runtime: Respect npm release-age filters for managed npm installs (#56957)
Zed-managed npm installers were resolving a concrete latest version with
`npm info` and then installing `package@version`. That is brittle when
users
configure npm release-age filtering via `before` or `min-release-age`:
npm's
installer applies those rules during resolution, but our pinned install
target
could disagree with it, and therefore fail to install.

This changes managed npm installs to install `package@latest` and let
npm apply
its own resolver and user config. The local latest-version lookup
remains as a
best-effort cache freshness check, not as the exact install target.

Exact extension API installs remain unchanged because extensions
explicitly
request a package and version. If we want to revisit that we can.

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 #53611

Release Notes:

- Fixed npm-backed tool installs to better respect npm release-age
filters.
2026-05-18 21:10:06 +00:00
Lukas Wirth
c8f0026867
gpui: Remove unsound await_on_background helper (#56132)
The function is unsound due to the classic fact that one can leak tasks,
sidestepping the blocking drop behavior resulting in a use after free.

Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-08 09:30:34 +00:00
YangChengxxyy
7fcc4ba343
eslint: Fix workspaceFolder.uri sent as raw path instead of `file:/… (#54383)
…/` URI

The ESLint adapter was sending `workspaceFolder.uri` as a raw filesystem
path (e.g. `/Users/foo/project`) instead of a proper `file://` URI (e.g.
`file:///Users/foo/project`).

This caused the vscode-eslint server's `workingDirectory: { mode: "auto"
}` to fail when resolving the workspace root, falling back to the linted
file's directory as the working directory. As a result,
`eslint-import-resolver-typescript` could not locate `tsconfig.json`,
breaking path alias resolution for rules like `import/order` — producing
different lint results compared to VS Code.

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


Release Notes:

- N/A or Added/Fixed/Improved ...
2026-05-07 08:58:17 +00:00
Xin Zhao
5dd9082d05
bash: Add built-in language server support (#52811)
Some checks are pending
Congratsbot / congrats (push) Blocked by required conditions
deploy_nightly_docs / deploy_docs (push) Waiting to run
run_tests / doctests (push) Blocked by required conditions
Congratsbot / check-author (push) Waiting to run
run_tests / check_workspace_binaries (push) Blocked by required conditions
run_tests / orchestrate (push) Waiting to run
run_tests / check_style (push) Waiting to run
run_tests / clippy_windows (push) Blocked by required conditions
run_tests / clippy_linux (push) Blocked by required conditions
run_tests / check_scripts (push) Blocked by required conditions
run_tests / clippy_mac (push) Blocked by required conditions
run_tests / clippy_mac_x86_64 (push) Blocked by required conditions
run_tests / run_tests_windows (push) Blocked by required conditions
run_tests / run_tests_linux (push) Blocked by required conditions
run_tests / run_tests_mac (push) Blocked by required conditions
run_tests / build_visual_tests_binary (push) Blocked by required conditions
run_tests / check_wasm (push) Blocked by required conditions
run_tests / check_dependencies (push) Blocked by required conditions
run_tests / check_docs (push) Blocked by required conditions
run_tests / check_licenses (push) Blocked by required conditions
run_tests / check_postgres_and_protobuf_migrations (push) Blocked by required conditions
run_tests / extension_tests (push) Blocked by required conditions
run_tests / tests_pass (push) Blocked by required conditions
This PR introduces native LSP support for Bash by integrating
`bash-language-server`. Combined with the existing Tree-sitter grammar,
Zed now provides a complete, out-of-the-box development experience for
shell scripting.

The implementation is very similar to other npm-managed language
servers. With `shellcheck` installed, standard LSP features—including
diagnostics, code actions, go-to-definition, find-references, and code
completion—work as expected.

Since I am not a frequent user of Bash, I have intentionally limited
this implementation to a standard, "out-of-the-box" setup. I lack the
hands-on experience to identify specific pain points or advanced LSP
features that might require custom integration, so I've avoided adding
any speculative or specialized configurations, especially within the
`LspAdapter` trait.

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

Closes #51917 

Release Notes:

- Added built-in language server support for Bash

---------

Co-authored-by: Finn Evers <finn@zed.dev>
2026-05-06 22:38:44 +00:00
Adam Ehlers Nyholm Thomsen
b5abd9d2fe
Fix micromamba powershell activation (#55643)
Powershell does not support eval, furthermore pwsh is also a
"powershell" shell for micromamba.

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:

- Fixes micromamba powershell activation
2026-05-04 16:44:18 +00:00
Tomas Esteves
ae08089415
Fix "Run Debugger" failing silently when project does not compile (#52439)
## Context

Previously the Run Debugger gutter arrow would fail silently when the
Cargo.toml had garbage lines such as “asdfasdf”. This fix makes it so
that the error is detected and bubbles up to the editor, which will
notify the user with a toast diagnostic.

Closes #46716

## Fix



https://github.com/user-attachments/assets/2e9ac7e9-1306-4607-a762-457131473572


## How to Review

Small PR - focused on four different files:

In - `crates/languages/src/rust.rs`:
- `target_info_from_abs_path()` - The function signature was changed
from `Option<(Option<TargetInfo>, Arc<Path>)>` to
`Result<Option<(Option<TargetInfo>, Arc<Path>)>>`. A condition was added
to ensure that if the Cargo metadata command is unsuccessful, the
function returns an error instead of causing an EOF error while
deserializing the stdout of the command.
- `build_context()` - Added a `?` in `target_info_from_abs_path(path,
project_env.as_ref()).await` in order to return the error.
 
In - `crates/project/src/task_store.rs`:
- `local_task_context_for_location()` and
`remote_task_context_for_location()` - The functions signatures were
changed from `Task<Option<TaskContext>>` to
`Task<anyhow::Result<Option<TaskContext>>>` for the purpose of
propagating the error.

In - `crates/editor/src/editor_tests.rs`:
- `build_tasks_context()` - The function signature was changed from
`Task<Option<TaskContext>>` to
`Task<anyhow::Result<Option<TaskContext>>>` .
- `toggle_code_actions()` - In case `build_tasks_context()` fails, the
functions notifies the error to the user as a Toast notification.

In - `crates/editor/src/runnables.rs`:
- Since `build_tasks_context()` and
`task_store.task_context_for_location()` now return a Result, the
callers` spawn_nearest_task() `and `task_context()` were modified. The
resulting Result types are transformed to match the expected return
types of `TaskContext` and `Task<Option<TaskContext>>`

Two new tests were added. The first, `target_info_from_abs_path_failed`
in `crates/languages/src/rust.rs`, checks if the system properly catches
the error. The second,
`test_toggle_code_actions_build_tasks_context_error_notifies` in
`crates/editor/src/editor_tests.rs`, confirms that the editor triggers
the expected error notification.

## 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

Release Notes:

- Fixed the error: Run Debugger failing silently due to invalid
Cargo.toml content

---------

Co-authored-by: Lukas Wirth <lukas@zed.dev>
2026-05-04 06:50:38 +00:00
Yara 🏳️‍⚧️
320888142f
Rust 1.95 (#55104)
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 #ISSUE

Release Notes:

- N/A
2026-04-29 10:27:47 +00:00
Piotr Osiewicz
d7d1b54044
python: Respect user settings for toolchain discovery over the toolchain set in Zed (#48262)
Closes #46754

Release Notes:

- python: User settings now take precedence over toolchain set in Zed
for pyright/basedpyright
2026-04-27 08:40:41 +00:00
Kirill Bulatov
7cfdc06625
Fix offline lookup of clangd on Windows (#54781)
Closes https://github.com/zed-industries/zed/issues/54042
Part of https://github.com/zed-industries/zed/issues/9789

This binary was not found when Zed first downloads the release, and then
rerun offline on the same project.

Using a `clangd-windows-21.1.0.zip ` archive from
https://github.com/clangd/clangd/releases/tag/21.1.0

```
~/Downloads ❯ unzip -l clangd-windows-21.1.0.zip|rg clangd.exe
 46908928  08-27-2025 01:40   clangd_21.1.0/bin/clangd.exe
```

Similarly, delve releases are in
https://github.com/go-delve/delve/releases and codelldb are in
https://github.com/vadimcn/codelldb/releases

```
~/Downloads ❯ unzip -l codelldb-win32-x64.vsix|rg exe
  1014272  04-21-2026 03:05   extension/bin/codelldb-launch.exe
  4400128  04-21-2026 03:05   extension/adapter/codelldb.exe
   242176  04-14-2026 04:14   extension/lldb/bin/lldb.exe
  6272000  04-14-2026 04:14   extension/lldb/bin/lldb-server.exe
    96768  04-14-2026 01:42   extension/lldb/bin/lldb-argdumper.exe
    96768  04-14-2026 04:13   extension/lldb/lib/lldb-python/lldb/lldb-argdumper.exe
    35284  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/pygments/lexer.py
   101888  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/distlib/w64.exe
   168448  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/distlib/w64-arm.exe
    91648  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/distlib/w32.exe
   108032  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/distlib/t64.exe
   182784  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/distlib/t64-arm.exe
    97792  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/distlib/t32.exe
    12161  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/pygments/lexers/__init__.py
    74926  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/pygments/lexers/_mapping.py
    53448  04-14-2026 01:36   extension/lldb/lib/site-packages/pip/_vendor/pygments/lexers/python.py
```


Release Notes:

- Fixed offline lookup of clangd on Windows
2026-04-25 06:14:41 +00:00
Finn Evers
9b40411c6a
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
0ab64d6414
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
8b1520467b
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
Kirill Bulatov
76883bb983
Support code lens in the editor (#54100) 2026-04-22 20:02:45 +03:00
Emamul Andalib
f2cead49b1
languages: Fix nested object methods missing from outline panel (#50754)
Shorthand methods (`methodName() {}`) inside nested object literals were
not shown in the Outline panel. The outline query only captured
method_definition when it was a direct child of a variable_declarator's
object, so nested objects (e.g. `deep: { subFn() {} }`) were missed.

Extended the outline query to match method_definition in any object
node, not just top-level variable_declarator objects. Applied the fix to
TypeScript, JavaScript, and TSX outline definitions. Added tests for the
issue reproduction and edge cases.

Supporting evidence:
<img width="1352" height="812" alt="image"
src="https://github.com/user-attachments/assets/64868a70-abd3-4935-9c03-4c809b55262b"
/>

Fixes #48711

Release Notes:

- Fixed nested object methods not appearing in the Outline panel for
JavaScript and TypeScript files
2026-04-21 00:36:39 +02:00
Arthur Fournier
03414d8058
languages: Fix Python LSP workspace folder detection in uv workspaces (#53781)
Closes #47926

  ## Summary

When using a uv (or Poetry/PDM) workspace with multiple subprojects,
Python LSP servers (Pyright, Ruff, ty, etc.) are initialized with the
subproject directory as their workspace folder instead of the workspace
root. This happens because `PyprojectTomlManifestProvider::search()`
returns the first (innermost)
  `pyproject.toml` found walking up the directory tree.

  For example, in a uv workspace like:

  main-project/
  ├── pyproject.toml       # workspace root with [tool.uv.workspace]
  ├── uv.lock
  ├── packages/
  │   └── project-api/
  │       └── pyproject.toml   # subpackage
  └── projects/
      └── project-a/
          └── pyproject.toml   # subpackage

Opening a file in `packages/project-api/` would register
`packages/project-api/` as the LSP workspace folder instead of
`main-project/`.

  ## Approach

The fix uses lockfile existence as a heuristic to detect workspace
roots. The updated `search()` method walks all ancestors (similar to
`CargoManifestProvider`) and:

  - Tracks the **innermost** `pyproject.toml` as a fallback
- Tracks the **outermost** `pyproject.toml` that has a sibling lockfile
(`uv.lock`, `poetry.lock`, `pdm.lock`, or `Pipfile.lock`)
- Returns the outermost workspace root if found, otherwise falls back to
the innermost

This works within the existing `ManifestDelegate` interface (existence
checks only, no file content reading).

  | Scenario | Result |
  |---|---|
| uv workspace (root `pyproject.toml` + `uv.lock`) | Returns workspace
root |
| Poetry workspace (root `pyproject.toml` + `poetry.lock`) | Returns
workspace root |
| Simple project (single `pyproject.toml`, no lockfile) | Returns
project dir (unchanged) |
| Independent subprojects (no lockfile at any level) | Returns each
project's own dir (unchanged) |

Since the manifest provider is set at the Python **language** level,
this fix applies to all Python LSP servers (Pyright, Ruff, ty, etc.).

  ## Test plan

- [x] Added unit tests for `PyprojectTomlManifestProvider` covering all
scenarios above
- [x] Existing integration test
`test_running_multiple_instances_of_a_single_server_in_one_worktree`
passes (independent subprojects without lockfiles)
  - [x] `cargo check -p languages` compiles cleanly
- [x] Manual testing with a real uv workspace (Pyright and Ruff both
receive correct workspace root)

Release Notes:

- Fixed Python LSP servers (Pyright, Ruff, etc.) using the wrong
workspace folder in uv/Poetry/PDM workspaces with multiple subprojects.
2026-04-20 10:10:03 +02:00
Hamza Paracha
f722e2fb2f
Respect proxy settings when fetching JSON schemas (#53954)
This fixes #53819.

JSON schema downloads were still going through the JSON language server
without picking up Zed's configured proxy. On networks that require the
proxy, that made schema fetches fail even though the rest of the app
could connect normally.

This passes the proxy setting through to the JSON language server
configuration so schema requests follow the same network path as the
rest of Zed.

## Test plan
- `rustfmt --edition 2024 crates/languages/src/json.rs`
- `git diff --check -- crates/languages/src/json.rs`

Release Notes:

- Fixed JSON schema downloads ignoring Zed's proxy setting.

---------

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-04-15 21:06:21 -07:00
Finn Evers
4deb4008b8
language_core: Introduce fallback highlights (#52575)
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:

- Added the option for highlights from languages to specify fallbacks.
That means that if you have a pattern with the captures `@second.capture
@first.capture`, Zed will first try resolving a highlight from your
theme for the code fragment using the first capture, then look for the
second capture if no match for the first capture could be found.

---------

Co-authored-by: Kirill Bulatov <kirill@zed.dev>
2026-04-02 12:52:42 +00:00
Smit Barmase
9b610e20bf
languages: Update vscode-eslint to 3.0.24 and fix ESLint 8-10 breaking cases (#52886)
Closes #29757
Closes #49387

This PR upgrades ESLint language server from `vscode-eslint 2.4.4` to
upstream `microsoft/vscode-eslint 3.0.24`, and make the workspace
configuration version-aware so ESLint 8, 9, and 10 take the correct
config-mode path.

The key part is that the 3.x bump alone is not enough. This PR keeps Zed
out of that path except where it is still actually needed. Rest
heavy-lifting is done by eslint server itself.

Zed now only overrides ESLint settings in the two known broken cases:
- ESLint 8.21-8.56 flat config: send `experimental.useFlatConfig = true`
  - ESLint 9 legacy config: send `useFlatConfig = false`
  
All other cases defer to `vscode-eslint 3.x`'s own config and
working-directory discovery.

For testing, I created https://github.com/smitbarmase/eslint-repros,
which contains a versioned ESLint repros covering root flat config,
legacy config, and package-local monorepo cases across ESLint 8, 9, and
10. Here is compare between `zed/main`, a pure `vscode-eslint 3.x`
upgrade and this branch with the config-mode fixes:

  ## zed main

  ```text
  eslint-v8_21-flat-root-single
  eslint-v8_56-flat-package-local-monorepo  -> breaks on main
  eslint-v8_56-flat-root-single
  eslint-v8_56-legacy-root-single
  eslint-v8_57-flat-package-local-monorepo  -> breaks on main
  eslint-v8_57-flat-root-single
  eslint-v8_57-legacy-root-single
  eslint-v9_0-flat-package-local-monorepo
  eslint-v9_0-flat-root-single
  eslint-v9_0-legacy-root-single            -> breaks on main
  eslint-v10_0-flat-package-local-monorepo
  eslint-v10_0-flat-root-single             -> breaks on main
  ```
  
  ## vscode-eslint 3.x upgrade

  ```text
  eslint-v8_21-flat-root-single
  eslint-v8_56-flat-package-local-monorepo  -> breaks on 3.x upgrade
  eslint-v8_56-flat-root-single
  eslint-v8_56-legacy-root-single
  eslint-v8_57-flat-package-local-monorepo
  eslint-v8_57-flat-root-single
  eslint-v8_57-legacy-root-single
  eslint-v9_0-flat-package-local-monorepo
  eslint-v9_0-flat-root-single
  eslint-v9_0-legacy-root-single            -> breaks on 3.x upgrade
  eslint-v10_0-flat-package-local-monorepo
  eslint-v10_0-flat-root-single             -> breaks on 3.x upgrade
  ```
  
  ## vscode-eslint 3.x upgrade + use flat config fixes

  ```text
  eslint-v8_21-flat-root-single
  eslint-v8_56-flat-package-local-monorepo
  eslint-v8_56-flat-root-single
  eslint-v8_56-legacy-root-single
  eslint-v8_57-flat-package-local-monorepo
  eslint-v8_57-flat-root-single
  eslint-v8_57-legacy-root-single
  eslint-v9_0-flat-package-local-monorepo
  eslint-v9_0-flat-root-single
  eslint-v9_0-legacy-root-single
  eslint-v10_0-flat-package-local-monorepo
  eslint-v10_0-flat-root-single
  ```
  
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

Release Notes:

- Fixed ESLint not reporting diagnostics in some cases for projects that
use flat-config, legacy-config, and monorepo projects across ESLint 8,
9, and 10.
2026-04-01 21:37:28 +05:30
Smit Barmase
ac20488113
eslint: Fix ESLint server startup failure on stale cached server install (#52883)
Closes
https://github.com/zed-industries/zed/issues/19709#issuecomment-3494789304
Closes
https://github.com/zed-industries/zed/issues/24194#issuecomment-2835787560

This PR fixes case where if eslint cached install is partial or stale,
Zed can try to launch a missing `eslintServer.js` and the server crashes
with `MODULE_NOT_FOUND`.

```
Error: Cannot find module '/Users/.../languages/eslint/vscode-eslint-2.4.4/vscode-eslint/server/out/eslintServer.js'
```

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 ESLint server startup failures caused by reusing an incomplete
or stale cached server install.
2026-04-01 14:10:23 +05:30
Finn Evers
79347e8ca5
Restore language query watcher in dev builds (#52543)
The watcher had been broken for some time, but became even more broken
after the recent move of the queries.

This PR restores the reloading behavior for debug builds so that
languages are reloaded once a scheme file is changed.

Release Notes:

- N/A
2026-03-27 11:10:57 +01:00
Nathan Sobo
3ce0cd11ec
Extract language_core and grammars crates from language (#52238)
This extracts a `language_core` crate from the existing `language`
crate, and creates a `grammars` data crate. The goal is to separate
tree-sitter grammar infrastructure, language configuration, and LSP
adapter types from the heavier buffer/editor integration layer in
`language`.

## Motivation

The `language` crate pulls in `text`, `theme`, `settings`, `rpc`,
`task`, `fs`, `clock`, `sum_tree`, and `fuzzy` — all of which are needed
for buffer integration (`Buffer`, `SyntaxMap`, `Outline`,
`DiagnosticSet`) but not for grammar parsing or language configuration.
Extracting the core types lets downstream consumers depend on
`language_core` without pulling in the full integration stack.

## Dependency graph after extraction

```
language_core   ← gpui, lsp, tree-sitter, util, collections
grammars        ← language_core, rust_embed, tree-sitter-{rust,python,...}
language        ← language_core, text, theme, settings, rpc, task, fs, ...
languages       ← language, grammars
```

## What moved to `language_core`

- `Grammar`, `GrammarId`, and all query config/builder types
- `LanguageConfig`, `LanguageMatcher`, bracket/comment/indent config
types
- `HighlightMap`, `HighlightId` (theme-dependent free functions
`highlight_style` and `highlight_name` stay in `language`)
- `LanguageName`, `LanguageId`
- `LanguageQueries`, `QUERY_FILENAME_PREFIXES`
- `CodeLabel`, `CodeLabelBuilder`, `Symbol`
- `Diagnostic`, `DiagnosticSourceKind`
- `Toolchain`, `ToolchainScope`, `ToolchainList`, `ToolchainMetadata`
- `ManifestName`
- `SoftWrap`
- LSP data types: `BinaryStatus`, `ServerHealth`,
`LanguageServerStatusUpdate`, `PromptResponseContext`, `ToLspPosition`

## What stays in `language`

- `Buffer`, `BufferSnapshot`, `SyntaxMap`, `Outline`, `DiagnosticSet`,
`LanguageScope`
- `LspAdapter`, `CachedLspAdapter`, `LspAdapterDelegate` (reference
`Arc<Language>` and `WorktreeId`)
- `ToolchainLister`, `LanguageToolchainStore` (reference `task` and
`settings` types)
- `ManifestQuery`, `ManifestProvider`, `ManifestDelegate` (reference
`WorktreeId`)
- Parser/query cursor pools, `PLAIN_TEXT`, point conversion functions

## What the `grammars` crate provides

- Embedded `.scm` query files and `config.toml` files for all built-in
languages (via `rust_embed`)
- `load_queries(name)`, `load_config(name)`,
`load_config_for_feature(name, grammars_loaded)`, and `get_file(path)`
functions
- `native_grammars()` for tree-sitter grammar registration (behind
`load-grammars` feature)

## Pre-cleanup (also in this PR)

- Removed unused `Option<&Buffer>` from
`LspAdapter::process_diagnostics`
- Removed unused `&App` from `LspAdapter::retain_old_diagnostic`
- Removed `fs: &dyn Fs` from `ToolchainLister` trait methods
(`PythonToolchainProvider` captures `fs` at construction time instead)
- Moved `Diagnostic`/`DiagnosticSourceKind` out of `buffer.rs` into
their own module

## Backward compatibility

The `language` crate re-exports everything from `language_core`, so
existing `use language::Grammar` (etc.) continues to work unchanged. The
only downstream change required is importing `CodeLabelExt` where
`.fallback_for_completion()` is called on the now-foreign `CodeLabel`
type.

Release Notes:

- N/A

---------

Co-authored-by: Agus Zubiaga <agus@zed.dev>
Co-authored-by: Tom Houlé <tom@tomhoule.com>
2026-03-25 23:41:09 +00:00
AltCode
28e521f1aa
elixir: Fix HEEx name and add EEx defaults (#49812)
- zed-extensions/elixir#61 renames `HEEX` to `HEEx`; to prevent any
disruptions from that change, this adds the correct name alongside a
settings migration
- zed-extensions/elixir#101 adds support for `EEx` templates; this sets
the default language server to be the same as that of `Elixir` and
`HEEx`

This also adds a few more extensions that should be recognized as `HEEx`
files

Release Notes:

- N/A

---------

Co-authored-by: Finn Evers <finn@zed.dev>
2026-03-25 13:46:18 +01:00
Marat Fattakhov
90fa50a617
go: Add semantic token rule for format string interpolations (#52394)
## Context

Closes #52391

gopls sends semantic tokens for format args with [format] modifier.
Without a simple support for there is no special highlighting for format
args like `%s`. Its a simple change inside
`go/semantic_token_rules.json` that makes this a default behavior.

Currently (on 0.229 preview):
<img width="1136" height="675" alt="Screenshot 2026-03-25 at 11 34 57"
src="https://github.com/user-attachments/assets/cd3d9a52-6740-47b5-8f05-02514cb4f9df"
/>

After fix:

<img width="1136" height="675" alt="Screenshot 2026-03-25 at 11 58 37"
src="https://github.com/user-attachments/assets/5ec4277b-39c1-4fe1-bed5-8a6fa63c18c9"
/>


## 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
- [x] Performance impact has been considered and is acceptable

Release Notes:

- gopls: Add semantic token rule for format string interpolations
2026-03-25 09:16:03 +00:00
Vincenzo Palazzo
3d5ec540f3
Add .tar.bz2 archive support for ACP agent server downloads (#52188)
## Summary

- Added `TarBz2` variant to `AssetKind` enum for `.tar.bz2` / `.tbz2`
archives
- Implemented `extract_tar_bz2` using the `bzip2` feature of
`async-compression` (already a workspace dependency, just enabled the
feature flag)
- Wired up both streaming and file-based extraction paths in
`github_download.rs`
- Added `.tar.bz2` / `.tbz2` URL detection in both
`LocalExtensionArchiveAgent` and `LocalRegistryArchiveAgent`

This unblocks ACP registry entries (like Goose) that only ship
`.tar.bz2` archives.

Reference: https://github.com/block/goose/issues/8047

## Test plan

- [ ] Verify `cargo check` and `clippy` pass (confirmed locally)
- [ ] Test downloading an ACP agent that ships a `.tar.bz2` archive
(e.g., Goose)
- [ ] Verify existing `.tar.gz` and `.zip` agent downloads still work

Release Notes:

- Added support for `.tar.bz2` archives in ACP agent server downloads,
unblocking registry entries like Goose that only ship bzip2-compressed
tarballs.

---------

Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
2026-03-25 07:54:23 +00:00
Marc-Andre Lureau
58fec75396
Add vim/emacs modeline support (#49267)
Many editors such as vim and emacs support "modelines", a comment at the
beginning of the file that allows the file type to be explicitly
specified along with per-file specific settings

- The amount of configurations, style and settings mapping cannot be
handled in one go, so this opens up a lot of potential improvements.
- I left out the possiblity to have "zed" specific modelines for now,
but this could be potentially interesting.
- Mapping the mode or filetype to zed language names isn't obvious
either. We may want to make it configurable.

This is my first contribution to zed, be kind. I struggled a bit to find
the right place to add those settings. I use a similar approach as done
with editorconfig (merge_with_editorconfig). There might be better ways.

Closes #4762

Release Notes:

- Add basic emacs/vim modeline support.

Supersedes #41899, changes:
- limit reading to the first and last 1kb
- add documentation
- more variables handled
- add Arc around ModelineSettings to avoid extra cloning
- changed the way mode -> language mapping is done, thanks to
`modeline_aliases` language config
- drop vim ex: support
- made "Local Variables:" handling a separate commit, so we can drop it
easily
- various code style improvements

---------

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
2026-03-25 03:15:51 +00:00
Chris Biscardi
6d3ebd4ffe
Upgrade tree-sitter-rust, de-list bsn (#52251)
## Context

Recently, we put bsn in the list of "macros to not reparse as rust"
(#51353).

We have since updated tree-sitter-rust to better handle the `@"string"`,
`:"string"`, etc cases, and can un-list bsn from the special casing.

on main, the highlighting currently looks like this for `bsn` and for
`not` (represents "other macros"). Note the `:"player.bsn"` string is
re-parsed as rust tokens.

<img width="1728" height="1084" alt="Screenshot 2026-03-23 at 9 33
35 AM"
src="https://github.com/user-attachments/assets/94ea5a6d-228b-44dd-857b-c41edcbd9af0"
/>

This pr, plus the tree-sitter-rust updates results in better handling by
default.

<img width="1728" height="1084" alt="Screenshot 2026-03-23 at 11 38
47 AM"
src="https://github.com/user-attachments/assets/fb6f71e3-7bcf-4c06-8e84-ce0823010b2e"
/>

Release Notes:

- N/A
2026-03-23 17:29:01 -07:00
Xin Zhao
23e1bcf59d
languages: Improve semantic token highlighting for parameters and Python (#52130)
## Context

Zed's semantic token highlighting does not cover all token types
returned by language servers, so the highlighting looks fairly primitive
compared with tree-sitter highlighting, especially for Python language
servers. This PR adds some global and Python-specific rules for better
highlighting.

I need to admit that the built-in Python language servers currently have
weak semantic highlighting implementations. Pylance, the closed-source
Python language server from Microsoft, provides the best highlighting
for now, but I think ty will do better, even though it still has a long
way to go.
## How to Review

Basically, this is a rule-adding change. Some rules are made global, and
some are made Python-specific.

## 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)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Improved semantic token highlighting for parameters and Python
2026-03-23 16:10:55 +00:00
Om Chillure
a75b8c83c6
languages: Highlight await as keyword.control in JS/TS/TSX files (#52034)
## Context

Fixes https://github.com/zed-industries/zed/issues/51921

`await` was grouped under the generic `@keyword` capture in the
tree-sitter highlights queries for JavaScript, TypeScript, and TSX. It
should be `@keyword.control`, since it's a control flow keyword — same
as `return`, `yield`, `throw`, `break`, etc., which were already
correctly classified.

This aligns Zed's highlighting with VSCode's behavior, where `await` is
tokenized as `keyword.control`.

## How to Review

Three single-line moves across highlights files — `await` removed from
the `@keyword` list, added to the `@keyword.control` list:
1. `crates/languages/src/javascript/highlights.scm`
2. `crates/languages/src/typescript/highlights.scm`
3. `crates/languages/src/tsx/highlights.scm`

## 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)
- [ ] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

## Image :
<img width="3072" height="1728" alt="Screenshot from 2026-03-20
22-15-40"
src="https://github.com/user-attachments/assets/9e849d4d-dad4-4fa0-b3b8-8e633f96c585"
/>

Release Notes:

- Fixed `await` keyword not being highlighted as `keyword.control` in
JavaScript, TypeScript, and TSX files

---------

Co-authored-by: Kunall Banerjee <hey@kimchiii.space>
2026-03-23 15:34:03 +02:00
Rodrigo
84d70ced05
languages: Support more JSON configuration files (#50800)
Several widely used configuration files are JSON but have no `.json`
extension,
such as `.babelrc` or `.eslintrc`.

Editors like VS Code detect these as JSON automatically, but Zed
currently
treats them as plain text.

This change adds common JSON config suffixes so they get proper JSON
syntax
highlighting.

Added:
- [`.babelrc`](https://babeljs.io/docs/config-files)
-
[`.eslintrc`](https://archive.eslint.org/docs/user-guide/configuring/configuration-files)
- [`.stylelintrc`](https://stylelint.io/user-guide/configure/)
- [`.swcrc`](https://github.com/swc-project/swc/pull/4236)

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Support more JSON configuration files
2026-03-18 15:45:03 +00:00
Xin Zhao
46596a2570
python: Upgrade pet to improve toolchain discovery in WSL (#51749)
This PR updates the pet dependency to incorporate performance
improvements from upstream.

Related Upstream Changes:
- Issue: microsoft/python-environment-tools#369
- PR: microsoft/python-environment-tools#370

Updating pet reduces toolchain discovery time in WSL environments,
specifically when Conda is installed on the host Windows system. In my
testing, the time from clicking the toolchain button to the list
appearing was reduced by approximately 2 seconds.

While this is a notable improvement, discovery in WSL remains slightly
slower than in native development or remote Linux environments, where
toolchains are typically loaded near-instantaneously.

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing (no need)
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Improved python toolchain discovery under WSL environment
2026-03-18 07:18:29 +01:00
Haojian Wu
e6939ad05c
languages: Recognize module interface file as C++ file (#45968)
https://clang.llvm.org/docs/StandardCPlusPlusModules.html#file-name-requirements,
`.cppm`, '.ccm', ".cxxm" files are C++20 module interface files.

Release Notes:

- Recognize module interface file as C++ file.
2026-03-18 06:10:58 +00:00
Finn Eitreim
5b6201d2b2
languages: Fix semantic tokens for Go (#51621)
Closes #51620

gopls requires more specific initialization for semantic tokens that
other language-servers for reasons that aren't entirely clear to me, it
is however a small fix to make it work. still trying to track down other
malfunctioning language servers in the semantic token realm, so if you
have suggestions let me know.

original behavior (on nightly v0.229):
<img width="1784" height="1123" alt="nightly_behavior"
src="https://github.com/user-attachments/assets/5d976b34-2720-425c-8617-800291862909"
/>

updated behavior:
<img width="1784" height="1124" alt="fix_applied"
src="https://github.com/user-attachments/assets/17c528b9-fea8-4309-9306-44673afc9fc3"
/>

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- gopls: fixed semantic token support with gopls.
2026-03-17 09:03:46 +01:00
ozacod
e5a69d8949
lsp: Add clangd readonly token modifier to semantic token rules to highlight constant variables as constant (#49065)
Clangd uses the "readonly" token modifier instead of "constant".
Therefore, "readonly" should be mapped to highlight constant variables
as constants.

Before:
<img width="706" height="48" alt="before"
src="https://github.com/user-attachments/assets/8cc2a310-7825-490b-b868-58ea231612fa"
/>

After:
<img width="762" height="46" alt="after"
src="https://github.com/user-attachments/assets/e271d4cd-cc59-45f9-a8b4-2885857915db"
/>

- [x] Code Reviewed
- [x] Manual QA

Release Notes:

- Added clangd readonly token modifier to semantic token rules to
highlight constant variables as constant.

Co-authored-by: ozacod <ozacod@users.noreply.github.com>
2026-03-16 07:35:29 +00:00
Kurian Jojo
da8a7e8b50
markdown: Fix block quote continuation highlighting (#51465)
There is no highlight for block quotes continued on multiple lines

Currently, the ">" on lines 2 and 3 are not highlighted in the same way
as line 1
<img width="291" height="73" alt="image"
src="https://github.com/user-attachments/assets/7a2f2e25-6ee1-40a6-8833-f06ca7ee6ba9"
/>

After this PR,
<img width="249" height="75" alt="image"
src="https://github.com/user-attachments/assets/34a2971f-8061-4d92-ac45-a8043d5d0566"
/>


for this input
```md
> abcd
>
> abcd
```

tree-sitter produces this 
```
(document [0, 0] - [3, 0]
  (section [0, 0] - [3, 0]
    (block_quote [0, 0] - [3, 0]
      (block_quote_marker [0, 0] - [0, 2])
      (paragraph [0, 2] - [1, 1]
        (inline [0, 2] - [0, 6])
        (block_continuation [1, 0] - [1, 1]))
      (block_continuation [2, 0] - [2, 2])
      (paragraph [2, 2] - [3, 0]
        (inline [2, 2] - [2, 6])))))
```

the screenshots in #43043 also show this issue

Release Notes:

- Fixed highlighting of block quotes continued over multiple lines in
markdown files
2026-03-14 00:09:19 +01:00
Xin Zhao
e0881e38f9
python: Add label_for_symbol for ty adapter (#51355)
Ported `label_for_symbol` logic directly from the basedpyright adapter
without adjustments.

Given Python's dynamic nature, the current implementation provides
sufficient coverage. No further modifications are needed for now.

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed missing syntax highlighting in symbol search when using the ty
language server.
2026-03-12 13:24:51 +01:00
Smit Barmase
f627c43ea1
languages: Prevent bsn macro from injecting rust layer (#51353)
Closes https://github.com/zed-industries/zed/issues/51240

We don’t parse bsn as embedded Rust anymore. We expect bsn to get its
own Tree-sitter implementation in the future, which should improve this.
This fixes broken syntax highlighting for string literals. See line 66
in the comparison below.

<img width="2560" height="1440" alt="image"
src="https://github.com/user-attachments/assets/230ae057-f315-4290-8f51-bcd21e6557d7"
/>

Release Notes:

- N/A

Co-authored-by: Christopher Biscardi <chris@christopherbiscardi.com>
2026-03-12 11:49:32 +05:30
Jack
4507210922
languages: Exclude angle brackets from rainbow bracket colorization for TSX (#51311)
## Summary

Angle brackets in TSX (`<`, `>`, `/>`, `</`) are always paired with JSX
tag syntax — they don't indicate bracket nesting depth — so rainbow
colorization adds noise without useful information.

This mirrors #46808, which applied the same fix to the HTML extension.

## Changes

- Added `(#set! rainbow.exclude)` to all three angle bracket patterns in
`crates/languages/src/tsx/brackets.scm`

## 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.

> Screenshots: I don't have a built copy of Zed handy to attach — happy
to add one if a maintainer needs it before merging.

Release Notes:

- Removed rainbow bracket colorization for angled brackets within TSX.
2026-03-11 17:55:15 +00:00
Kyle Kelley
c08fd438ec
languages: Validate pylsp binary before returning from check_if_user_installed (#51034)
Run `pylsp --version` via `delegate.try_exec()` in both branches of
`PyLspAdapter::check_if_user_installed` before returning the binary. If
execution fails (broken shebang, missing interpreter, etc.), log a
warning and return None so the system falls through gracefully instead
of surfacing an error dialog.

This matches the existing validation pattern used by TyLspAdapter and
RuffLspAdapter in their `fetch_server_binary` implementations.

No idea if this closes an issue but it sure was annoying on a system
where I deleted the pylsp environment I had. It surprised me too since I
had pylsp disabled in settings.

Release Notes:

- Fixed detection of when `pylsp` is not installed properly on a user's
system so that it doesn't get launched as an LSP when it doesn't exist.
2026-03-11 09:12:18 +01:00
Justin Su
7132b67962
Normalize line_comments strings to have a trailing space (#51033)
I did a search for `/^line_comments = .*[^\s\[]"/` to identify these 3
languages:

- Git Commit
- Go Mod
- Go Work

that don't add/remove a trailing space for inline comments. I couldn't
find any indication that the absence of the trailing space is due to any
peculiarity of these languages.

---

For Git Commit, I should note that (strictly speaking) the comment
character is a single `#` without a trailing space, as Git removes any
line starting with the default comment character (`#`) (see
https://git-scm.com/docs/git-config#Documentation/git-config.txt-corecommentChar).

But I believe this change only affects whether `editor::ToggleComments`
adds/removes the space, and not how the file is syntax highlighted. So
for aesthetics and consistency, it should be better to add/remove the
trailing space.

---

Before you mark this PR as ready for review, make sure that you have:

- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Add/remove a space when toggling inline comments in Git Commit and Go
Mod/Work languages
2026-03-10 19:41:24 +00:00
Piotr Osiewicz
97421c670e
Remove unreferenced dev dependencies (#51093)
This will help with test times (in some cases), as nextest cannot figure
out whether a given rdep is actually an alive edge of the build graph

Closes #ISSUE

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [ ] Done a self-review taking into account security and performance
aspects
- [ ] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A
2026-03-09 13:22:12 +01:00
Xin Zhao
a70c295658
python: Fix conda environment not auto-activated in remote terminal (#50895)
Closes #50619

In the conda activation script building procedure, Zed currently
performs a file check for the conda executable on the client side. When
in remote development, this check always fails because the file exists
on the remote host, not the local machine. Since `pet` already handles
existence checks, removing this redundant check allows the activation to
proceed. It is also better to let any potential issues (like
permissions) show up in the terminal rather than silently skipping the
activation.

This addresses the root cause for remote development, which is different
from the approach in #50715 that focuses on shell hooks.

**The video recording**


https://github.com/user-attachments/assets/62967351-e3c5-4814-aec4-b2332940e7e3

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed conda environment not auto-activating in the terminal during
remote development sessions.
2026-03-06 07:51:30 +00:00
Nianyu Shen
c0f5d21a88
lsp: Add semantic token rules for Go (#50641)
gopls reports Go `const` declarations as `variable` with the `readonly`
modifier. Add a Go-specific semantic token rule to map this to the
`constant` theme style, matching VS Code's behavior.

<img width="465" height="32" alt="image"
src="https://github.com/user-attachments/assets/e0bc8a60-2275-4f81-9185-8b86c51d3d08"
/>

Closes #50642

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-03-04 21:41:47 -07:00
moleium
de107768b1
Add .cppm (C++20 module interface) to C++ file extensions (#50667)
`.cppm` is the widely used extension for C++20 module interface units,
supported by MSVC, Clang, and GCC. Currently Zed doesn't recognize it as
C++, so users get no syntax highlighting or LSP support.

Changes:
`crates/languages/src/cpp/config.toml`: add cppm to path_suffixes
`crates/theme/src/icon_theme.rs`: add cppm to the C++ icon matcher

https://github.com/search?q=path%3A*.cppm&type=code

Release Notes:

- N/A
2026-03-04 10:30:33 +00:00
Xin Zhao
cdb34c30c9
python: Register LSP adapters directly to the LanguageRegistry (#50662)
The purpose of `register_available_lsp_adapter()` is to allow language
servers to be reused across multiple languages. Since adapters like
`ty`, `pylsp`, and `pyright` are specific to Python, there is no need to
register them for other languages. Additionally, registering them
directly to the global `LanguageRegistry` results in negligible resource
consumption.

We can then use the default settings to control the default language
server for Python, as referenced here:


9c9337a802/assets/settings/default.json (L2119-L2130)

Additionally, the documentation for Python has been updated to clarify
that the `"..."` syntax does not mean "keep the rest at default," but
rather "include all other available servers."

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing (no sure how to add test for this)
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-03-04 07:31:27 +00:00
Lukas Wirth
2b774e5cd2
extension_host: Allow extensions to define semantic highlighting rules (#49282)
for their given language via a `semantic_token_rules.json` file

Release Notes:

- N/A *or* Added/Fixed/Improved ...
2026-03-02 17:54:53 +01:00
Finn Evers
6a14388d38
languages: Add support for passing user settings to Go LSP adapter (#50472)
Closes https://github.com/zed-industries/zed/issues/50276

Release Notes:

- Added support for specifying settings for the Go LSP adapter
2026-03-02 09:33:48 +00:00
Finn Evers
5ed538f49c
Format Tree-sitter queries with ts_query_ls (#50138)
Release Notes:

- N/A
2026-02-27 12:49:45 +00:00
Kunall Banerjee
1c39e192f1
languages: Reorder type identifier highlights in JavaScript (#49325)
Move general type identifier rules before class-specific ones to ensure
proper precedence in the syntax highlighting query.

Closes #49226.

Before you mark this PR as ready for review, make sure that you have:
- [ ] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Fixed an issue where class names were not highlighted correctly in
JavaScript files
2026-02-27 03:14:40 +00:00
Kunall Banerjee
e8325318a0
languages: Add .prettierrc to JSON path_suffixes (#50156)
`.prettierrc` can be [written](https://prettier.io/docs/configuration)
in either JSON or YAML. Whether you write JSON or YAML, VS Code will
default to recognizing it as JSON. See screenshot.

Without this change, the user is forced to do:

```jsonc
"file_types": {
  "JSON": [".prettierrc"],
},
```

Small QoL improvement.

| VS Code | Zed (after the changes) |
|--------|--------|
| <img width="1732" height="1125" alt="image"
src="https://github.com/user-attachments/assets/1f9533fc-a77a-40f3-b8a5-6c36faeccffd"
/> | <img width="1732" height="1125" alt="image"
src="https://github.com/user-attachments/assets/bef8ca94-006c-44bd-ac1c-59f915b67123"
/> |

Closes #50072.

Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)

Release Notes:

- Added `.prettierrc` to JSON `path_suffixes`
2026-02-26 17:07:25 +00:00
Finn Evers
ff83f08243
python: Fix warning in injections query (#49397)
Release Notes:

- N/A
2026-02-25 16:46:27 +01:00