Removes `diagnostics.cargo.fetch_cargo_diagnostics` settings as those
are not needed for the flycheck diagnostics to run.
This setting disabled `checkOnSave` in rust-analyzer and allowed to
update diagnostics via flycheck in the project diagnostics editor with
the "refresh" button.
Instead, `"checkOnSave": false,` can be set manually as
https://zed.dev/docs/languages/rust#more-server-configuration example
shows and flycheck commands can be called manually from anywhere,
including the diagnostics panel, to refresh the diagnostics.
Release Notes:
- Removed redundant `diagnostics.cargo.fetch_cargo_diagnostics` settings
Currently shorthand field initializers are not captured the same way as
the full initializers, leading to awkward and mismatching highlighting.
This PR addresses this fact, in addition to capturing new highlights:
- Tags the `!` as part of a macro invocation.
- Tags the identifier part of a lifetime as `@lifetime`.
- Tag module definitions as a new capture group, `@module`.
- Shorthand initializers are now properly tagged as `@property`.
Here's what the current version of Zed looks like:
<img width="596" height="683" alt="image"
src="https://github.com/user-attachments/assets/c9e52d8e-03dc-426b-8545-4fe872b803e0"
/>
With the new highlighting applied:
<img width="596" height="683" alt="image"
src="https://github.com/user-attachments/assets/b7bd9391-9910-456b-8198-6871174d0f4f"
/>
Release Notes:
- Improved highlighting of Rust files, including new highlight groups
for modules and shorthand initializers.
This removes around 900 unnecessary clones, ranging from cloning a few
ints all the way to large data structures and images.
A lot of these were fixed using `cargo clippy --fix --workspace
--all-targets`, however it often breaks other lints and needs to be run
again. This was then followed up with some manual fixing.
I understand this is a large diff, but all the changes are pretty
trivial. Rust is doing some heavy lifting here for us. Once I get it up
to speed with main, I'd appreciate this getting merged rather sooner
than later.
Release Notes:
- N/A
Follow-up to #36469
Part of the issue was that we hadn't defined comment and string
overrides for some languages. Hence, even after the fix edit predictions
would show up in comments for me in e.g. JSONC files.
This PR adds some more overrides where possible for this repo to ensure
this happens less frequently.
Release Notes:
- N/A
Closes#34325
**Background**
When upgrading/reinstalling the ESLint language server, extracting the
archive over an existing version directory that contains symlinks can
fail and interrupt the installation.
```
failed to unpack .../vscode-eslint-2.4.4/.../client/src/shared
File exists (os error 17) when symlinking ../../$shared/ to .../client/src/shared
```
**Root cause**
Extracting into a non-empty directory conflicts with leftover
files/symlinks (e.g., `client/src/shared -> ../../$shared`), causing
“File exists (os error 17)”.
When `fs::metadata(&server_path).await.is_err()` is true, the code falls
back to cached_server_binary, but that still targets the same
(potentially corrupted/half-installed) directory and does not run `npm
install` or `npm run compile`, so the system cannot recover and remains
broken.
**Change**
Before downloading and extracting, delete the target version directory
(vscode-eslint-<version>) to ensure an empty extraction destination and
avoid conflicts.
**Alternative approaches**
temp directory + rename: extract into a clean temp directory and rename
into place to avoid half-installed states
[async-tar](https://github.com/dignifiedquire/async-tar) enhancement:
tolerate already-existing symlinks (or add a “replace-existing” option).
Release Notes:
- Fixed eslint installation not clearing files after previous attempts'
- **WIP: reorganize dispositions**
- **Introduce a LocalToolchainStore trait and use it for LspAdapter
methods**
Closes#35782Closes#27331
Release Notes:
- Python: Improved propagation of a selected virtual environment into
the LSP configuration. This should the make all language-related
features such as Go to definition or Find all references more reliable.
---------
Co-authored-by: Cole Miller <cole@zed.dev>
Co-authored-by: Lukas Wirth <lukas@zed.dev>
Follow-up for #36093 and
https://github.com/zed-industries/zed/pull/36138
Since v1.355.0, `@github/copilot-language-server` has stopped responding
to `CheckStatus` requests if a `DidChangeConfiguration` notification
hasn’t been sent beforehand. This causes `CheckStatus` to remain in an
await state until it times out, leaving the connection stuck for a long
period before finally throwing a timeout error.
```rs
let status = server
.request::<request::CheckStatus>(request::CheckStatusParams {
local_checks_only: false,
})
.await
.into_response() // bails here with ConnectionResult::Timeout
.context("copilot: check status")?;
````
This PR fixes the issue by sending the `DidChangeConfiguration`
notification before making the `CheckStatus` request. It’s just an
ordering change i.e. no other LSP actions occur between these two calls.
Previously, we only updated our internal connection status and UI in
between.
Release Notes:
- Fixed an issue where GitHub Copilot could get stuck and fail to sign
in.
Closes#36093
Pin copilot version to 1.354 for now until further investigation.
Release Notes:
- Fixes issue where Copilot failed to sign in.
Co-authored-by: MrSubidubi <dev@bahn.sh>
An alternative might be to adjust the logic to not nest items when their
ranges are the same, but then clicking them doesn't work properly /
moving the cursor does not change which is selected. This could probably
be made to work with some extra logic there, but it seems overkill.
The downside of fixing it at the query level is that other parts of the
declaration are not inside the item range. This seems to be fine for
single line declarations - the nearest outline item is highlighted.
However, if a part of the declaration is not included in an item range
and is on its own line, then no outline item is highlighted.
Release Notes:
- Outline Panel: Fixed nesting of var and field declarations with
multiple identifiers in Go and C++
C++ before:
<img width="743" height="227" alt="image"
src="https://github.com/user-attachments/assets/af1a1d76-ecdc-4999-ae9c-95591726ccca"
/>
C++ after:
<img width="795" height="250" alt="image"
src="https://github.com/user-attachments/assets/49667ed3-e088-48b3-a9f0-6a119b5e7648"
/>
Go before:
<img width="859" height="306" alt="image"
src="https://github.com/user-attachments/assets/ecc7530a-ca16-4f37-b8d1-60687f178b12"
/>
Go after:
<img width="900" height="334" alt="image"
src="https://github.com/user-attachments/assets/d741cfb0-59e5-4d27-bd6a-f422204dc972"
/>
Closes https://github.com/zed-industries/zed/issues/34472
* Avoid removing the just-downloaded exe
* Invoke exe within nested version directory
Release Notes:
- Fix issue where Rust-analyzer was not installed correctly on windows
Co-authored-by: Lukas Wirth <lukas@zed.dev>
One killer feature for the Go runner is to execute individual subtests
within a table-test easily. Goland has had this feature forever, while
in VSCode this has been notably missing.
https://github.com/user-attachments/assets/363417a2-d1b1-43ca-8377-08ce062d6104
Release Notes:
- Added support to run Go table-test subtests.
Previously, this was the one thing that could not be styled properly in
ecmascript languages in the zed config, because it was not able to be
targeted.
Now, it is added alongside other operators. This has been tested and
works as expected.
Release Notes:
- N/A
rust-analyzer changed the format here a bit some months ago which
partially broke our nice detailed highlighted completion labels. The
brings that back while also cleaning up the code a bit.
Also fixes a bug where disabling rust-analyzers snippet callable
completions would fully break them.
Release Notes:
- N/A
Release Notes:
- Added GitHub artifact digest verification for rust-analyzer and clangd
binary downloads, skipping downloads if cached binary digest is up to
date
- Added verification that cached rust-analyzer and clangd binaries are
executable, if not they are redownloaded
---------
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
This PR changes the signature of `language_names` from
```rust
pub fn language_names(&self) -> Vec<String>
// Into
pub fn language_names(&self) -> Vec<LanguageName>
```
The function previously eagerly converted `LanguageName`'s to
`String`'s, which requires the reallocation of all of the elements. The
functions get called in many places in the code base, but only one of
which actually requires the conversion to a `String`. In one case it
would do a `SharedString` -> `String` -> `SharedString` conversion,
which is now totally bypassed.
Release Notes:
- N/A
Closes#30499
`vscode-css-language-server` throws a null reference error if no
workspace configuration is provided from the client.
Release Notes:
- Fixed issue where no diagnostics were shown for CSS, LESS, and SCSS.
This PR adds a built-in adapter for the basedpyright language server.
For now, it's behind the `basedpyright` feature flag, and needs to be
requested explicitly like this for staff:
```
"languages": {
"Python": {
"language_servers": ["basedpyright", "!pylsp", "!pyright"]
}
}
```
(After uninstalling the basedpyright extension.)
Release Notes:
- N/A
Temporarily fixes#29133
Co-authored-by: Cole <cole@zed.dev>
Release Notes:
- python: Zed now reports a slightly different set of workspace folders
for Python projects to work around quirks in handling of multi-lsp
projects with virtual environment. This behavior will be revisited in a
near future.
Co-authored-by: Cole <cole@zed.dev>
example of detected code:
```ts
Deno.test("t", () => {
console.log("Hello, World!");
});
Deno.test(function azaz() {
console.log("Hello, World!");
});
```
I can't build zed locally so I didn't test this, but I think the code is
straightforward enough, hopefully someone else can verify it
Closes #ISSUE
Release Notes:
- N/A
The regular expression for benchmarks was enforcing using a suffix
(e.g., `BenchmarkFoo`), but `Benchmark` is a valid benchmark name, just
as `Test` is a valid test name, and `Fuzz` is a valid fuzz test name.
Release Notes:
- Add support for running Go benchmarks named "Benchmark"
Closes#34390
This PR fixes several Bash indentation issues:
- Adding indentation or comment using multi cursors no longer breaks
relative indentation
- Adding newline now places the cursor at the correct indent
- Typing a valid keyword triggers context-aware auto outdent
It also adds tests for all of them.
Release Notes:
- Fixed various issues with handling indentation in Bash.
As suggested in https://github.com/zed-industries/zed/pull/34418, this
proposes various changes to language configs to make block comments and
doc-block-style comments more similar. In doing so, it introduces some
breaking changes into the extension schema.
This change is needed to support the changes I'm working on in #34418,
to be able to support `rewrap` in block comments like `/* really long
comment ... */`. As is, we can do this in C-style doc-block comments (eg
`/** ... */`) because of the config in `documentation`, but we can't do
this in regular block comments because we lack the info about what the
line prefix and indentation should be.
And while I was here, I did various other clean-ups, many of which feel
nice but are optional.
I would love special attention on the changes to the schema, version and
related changes; I'm totally unfamiliar with that part of Zed.
**Summary of changes**
- break: changes type of `block_comment` to same type as
`documentation_comment` (**this is the important change**)
- break: rename `documentation` to `documentation_comment` (optional,
but improves consistency w/ `line_comments` and `block_comment`)
- break/refactor?: removes some whitespace in the declaration of
`block_comment` delimiters (optional, may break things, need input; some
langs had no spaces, others did)
- refactor: change `tab_size` from `NonZeroU32` to just a `u32` (some
block comments don't seem to need/want indent past the initial
delimiter, so we need this be 0 sometimes)
- refactor: moves the `documentation_comment` declarations to appear
next to `block_comment`, rearranges the order of the fields in the TOML
for `documentation_comment`, rename backing `struct` (all optional)
**Future scope**
I believe that this will also allow us to extend regular block comments
on newline – as we do doc-block comments – but I haven't looked into
this yet. (eg, in JS try pressing enter in both of these: `/* */` and
`/** */`; the latter should extend w/ a `*` prefixed line, while the
former does not.)
Release Notes:
- BREAKING CHANGE: update extension schema version from 1 to 2, change
format of `block_comment` and rename `documentation_comment`
/cc @smitbarmase
Supersedes: #34242
Creates an `ActionArgumentsEditor` that implements the required logic to
have a JSON language server run when editing keybinds so that there is
auto-complete for action arguments.
This is the first time action argument schemas are required by
themselves rather than inlined in the keymap schema. Rather than add all
action schemas to the configuration options we send to the JSON LSP on
startup, this PR implements support for the
`vscode-json-language-server` extension to the LSP whereby the server
will request the client (Zed) to resolve URLs with URI schemes it does
not recognize, in our case `zed://`. This limits the impact on the size
of the configuration options to ~1KB as we send URLs for the language
server to resolve on demand rather than the schema itself. My
understanding is that this is how VSCode handles JSON schemas as well. I
plan to investigate converting the rest of our schema generation logic
to this method in a follow up PR.
Co-Authored-By: Cole <cole@zed.dev>
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Closes#27118Closes#34165
Fix a small issue after we landed
https://github.com/zed-extensions/ruby/pull/113+ where we introduced
`HTML/ERB` and `YAML/ERB` language IDs to improve user experience. Sorry
about that. Thanks!
Release Notes:
- N/A
Before this, indentation did not automatically increase after
if/for/while/do/else statements in C++, and only increased after if/for
in C. This led to Zed using last line logic when inserting lines *after*
the indented statement, as well as not indenting the statement itself,
resulting in irregular indentation during typing.
Just adding indentation (similar to C) creates a new problem: now if a
scope is started with a brace on a new line, that brace is indented.
Thus we need to deindent it.
Using else_clause in the indent guide results in the else statement
being indented forward as well, so we need to deindent that too.
Note: the most significant issue for me is the one where indentation
jumps forward when inserting lines after indented lines. Unfortunately,
it appears that fixing that issue requires all of these other changes. I
would have preferred a simpler fix, but I'm not sure if disabling last
line behavior for C/C++ is appropriate as it probably breaks something
else, like cases where the file is incomplete and the statements can't
be parsed properly.
Editing flow before this change:
[Screencast From 2025-07-16
08-31-36.webm](https://github.com/user-attachments/assets/3dea86c5-47bd-47c2-aee8-b0aa613948e6)
Editing flow after this change:
[Screencast From 2025-07-16
08-35-36.webm](https://github.com/user-attachments/assets/7ef23e60-1ee3-49fd-90f9-d53f909ca674)
(note: the "else" snippet is completely breaking the flow here, but I
think that comes from clangd by default? Unfortunately I haven't found a
way to disable it cleanly but that is a separate problem that happens
right now too.)
Release Notes:
- Improve indentation during typing for C/C++ around if/for/while/do
blocks
Closes #ISSUE
Creates a new language in the languages crate for the DSL used in Zed
keybinding context. Previously, keybind context was highlighted as Rust
in the keymap UI due to the expression syntax of Rust matching that of
the context DSL, however, this had the side effect of highlighting upper
case contexts (e.g. `Editor`) however Rust types would be highlighted
based on the theme. By extracting only the necessary pieces of the Rust
language `highlights.scm`, `brackets.scm`, and `config.toml`, and
continuing to use the Rust grammar, we get a better result across
different themes
Release Notes:
- N/A *or* Added/Fixed/Improved ...
Functions like `function* iterateElements() {}` would not show up in the
editor's navigation outline. With this change, they do.
| **Before** | **After**
|-|-|
|<img width="453" height="280" alt="Screenshot 2025-07-13 at 4 58 22 PM"
src="https://github.com/user-attachments/assets/822f0774-bda2-4855-a6dd-80ba82fffaf3"
/>|<img width="564" height="373" alt="Screenshot 2025-07-13 at 4 58
55 PM"
src="https://github.com/user-attachments/assets/f4f6b84f-cd26-49b7-923b-724860eb18ad"
/>|
Note that I decided to use Zed's agent assistance features to do this PR
as a sort of test run. I don't normally code with an AI assistant, but
figured it might be good in this case since I'm unfamiliar with the
codebase. I must say I was fairly impressed. All the changes in this PR
were done by Claude Sonnet 4, though I have done a manual review to
ensure the changes look sane and tested the changes by running the
re-built `zed` binary with a toy project.
Closes#21631
Release Notes:
- Fixed JS/TS outlines to show generator functions.