Fixes an issue that caused Windows to fail when removing extension's
directories, as Zed had never stop any related processes.
Now:
* Zed shuts down and waits until the end when the language servers are
shut down
* Adds `impl Drop for WasmExtension` where does
`self.tx.close_channel();` to stop a receiver loop that holds the "lock"
on the extension's work dir.
The extension was dropped, but the channel was not closed for some
reason.
* Does more unregistration to ensure `Arc<WasmExtension>` with the `tx`
does not leak further
* Tidies up the related errors which had never reported a problematic
path before
Release Notes:
- N/A
---------
Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
Co-authored-by: Smit <smit@zed.dev>
Restarting sessions was broken in #33273 when we moved away from calling
`kill` in the shutdown sequence. This PR re-adds that `kill` call so
that old debug adapter processes will be cleaned up when sessions are
restarted within Zed. This doesn't re-introduce the issue that motivated
the original changes to the shutdown sequence, because we still send
Disconnect/Terminate to debug adapters when quitting Zed without killing
the process directly.
We also now remove manually-restarted sessions eagerly from the session
list.
Closes#33916
Release Notes:
- debugger: Fixed not being able to restart sessions for Debugpy and
other adapters that communicate over TCP.
- debugger: Fixed debug adapter processes not being cleaned up.
---------
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Previously if I set enabled: false for one the context servers in
settings.json it will not show up in the settings in agent panel when I
start zed. But if I enabled it from settings it properly showed up. We
were filtering the configuration to only get the enabled context servers
from settings.json. This PR adds fetching all of them.
Release Notes:
- agent: Show context servers which are disabled in settings in agent
panel settings.
There were a couple of things preventing this from working:
- our hack to stop the node REPL from appearing broke in recent versions
of the JS DAP that started passing `--experimental-network-inspection`
by default
- we had lost the ability to create a debug terminal without specifying
a program
This PR fixes those issues. We also fixed environment variables from the
**runInTerminal** request not getting passed to the spawned program.
Release Notes:
- Debugger: Fix RunInTerminal not working for JavaScript debugger.
---------
Co-authored-by: Cole Miller <cole@zed.dev>
Partially fixes:
https://github.com/zed-industries/zed/discussions/33777#discussioncomment-13646294
### Improves debug console autocompletion behavior
This PR fixes a regression in completion trigger support for the debug
console, as we only looked if a completion trigger, was in the beginning
of the search text, but we also had to check if the current text is a
word so we also show completions for variables/input that doesn't start
with any of the completion triggers.
We now also leverage DAP provided information to sort completion items
more effectively. This results in improved prioritization, showing
variable completions above classes and global scope types.
I also added for completion the documentation field, that directly comes
from the DAP server. NOTE: I haven't found an adapter that returns this,
but it needs to have.
**Before**
<img width="1200" alt="Screenshot 2025-07-03 at 21 00 19"
src="https://github.com/user-attachments/assets/611e8d38-e302-4995-a425-ce2c0a1843d4"
/>
**After**
<img width="1200" alt="Screenshot 2025-07-03 at 20 59 38"
src="https://github.com/user-attachments/assets/ab1312db-bbad-49b7-872d-712d6ec708d7"
/>
Release Notes:
- Debugger: Improve autocompletion sorting for debug console
- Debugger: Fix autocompletion menu now shown when you type
- Debugger: Fix completion item showing up twice for some adapters
Closes#33820
Release Notes:
- Improved performance of debug console when there are lots of output
events.
---------
Co-authored-by: Cole Miller <cole@zed.dev>
Closes https://github.com/zed-industries/zed/issues/33827
After #33644 was merged, we would not start MCP servers coming from
extensions correctly anymore. The optimization uncovered a bug in the
implementation of `ContextServerDescriptorRegistry`, because we never
called `cx.notify()` when adding/removing context servers.
`ContextServerStore` listens for these events, and before #33644 this
was just working because of aace condition.
Release Notes:
- agent: Fixed bug that prevented MCP servers to appear in the settings
view.
Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
Closes #ISSUE
Adds a new `documentation` method to actions, that is extracted from doc
comments when using the `actions!` or derive macros.
Additionally, this PR adds doc comments to as many action definitions in
Zed as possible.
Release Notes:
- N/A *or* Added/Fixed/Improved ...
This fixes an issue where lower-priority language servers cannot provide
contentful responses even when the first capable server returned empty
responses.
Most of the diffs are copypasted since the existing implementations were
also copypasted.
Release Notes:
- Improved Go to Definition / Declaration / Type Definition /
Implementation and Find All References to include all results from
different language servers
This PR revives zed-industries/zed#27818 and aims to complete the
partially implemented overloaded signature help feature.
The first commit is a rebase of zed-industries/zed#27818, and the
subsequent commit addresses all review feedback from the original PR.
Now the overloaded signature help works like
https://github.com/user-attachments/assets/e253c9a0-e3a5-4bfe-8003-eb75de41f672Closes#21493
Release Notes:
- Implemented signature help for overloaded items. Additionally, added a
support for rendering signature help documentation.
---------
Co-authored-by: Fernando Tagawa <tagawafernando@gmail.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Kirill Bulatov <mail4score@gmail.com>
Co-authored-by: Kirill Bulatov <kirill@zed.dev>
We reworked the debug modal spawning to use the task context from past
debug sessions when spawning a debug scenario based on task inventory
history.
We changed restart session keybinding to rerun session too.
Closes#31369
Release Notes:
- Restarting a debug session now reruns build tasks that are associated
with the session
---------
Co-authored-by: Cole Miller <cole@zed.dev>
As pointed out in https://github.com/probe-rs/probe-rs/issues/3333, we
violate the spec by sending setExceptionBreakpoints even when the
adapter does not define any exceptions.
Release Notes:
- N/A
- **debugger: Update exception breakpoints list on capability update**
- **Do not prefill codelldb sourcelanguages by default**
Release Notes:
- debugger: CodeLLDB no longer enables pretty-printers for Rust by
default. This fixes pretty-printers for C++. This is a breaking change
for user-defined debug scenarios from debug.json; in order to enable
Rust pretty printing when using CodeLLDB, add `"sourceLanguages":
["rust"]` to your debug configuration. This change does not affect
scenarios automatically inferred by Zed.
---------
Co-authored-by: Anthony Eid <anthony@zed.dev>
Closes#30017
* While generating the settings JSON schema, defaults all schema
definitions to reject unknown fields via `additionalProperties: false`.
* Uses `unevaluatedProperties: false` at the top level to check fields
that remain after the settings field names + release stage override
field names.
* Changes json schema version from `draft07` to `draft_2019_09` to have
support for `unevaluatedProperties`.
Release Notes:
- Added warnings for unknown fields when editing `settings.json`.
The major change in schemars 1.0 is that now schemas are represented as
plain json values instead of specialized datatypes. This allows for more
concise construction and manipulation.
This change also improves how settings schemas are generated. Each top
level settings type was being generated as a full root schema including
the definitions it references, and then these were merged. This meant
generating all shared definitions multiple times, and might have bugs in
cases where there are two types with the same names.
Now instead the schemar generator's `definitions` are built up as they
normally are and the `Settings` trait no longer has a special
`json_schema` method. To handle types that have schema that vary at
runtime (`FontFamilyName`, `ThemeName`, etc), values of
`ParameterizedJsonSchema` are collected by `inventory`, and the schema
definitions for these types are replaced.
To help check that this doesn't break anything, I tried to minimize the
overall [schema
diff](https://gist.github.com/mgsloan/1de549def20399d6f37943a3c1583ee7)
with some patches to make the order more consistent + schemas also
sorted with `jq -S .`. A skim of the diff shows that the diffs come
from:
* `enum: ["value"]` turning into `const: "value"`
* Differences in handling of newlines for "description"
* Schemas for generic types no longer including the parameter name, now
all disambiguation is with numeric suffixes
* Enums now using `oneOf` instead of `anyOf`.
Release Notes:
- N/A
Stop doing useless prettier-related work when doing a project search.
Before, project search might cause
<img width="1728" alt="not_pretty"
src="https://github.com/user-attachments/assets/5f8b935f-962d-488e-984f-50dfbaee97ba"
/>
but now we debounce the prettier-related task first, and actually set
the "installed" state for the default prettier, when there's no install
needed.
Release Notes:
- N/A
Previously we would always run `maintain_servers` even if the settings
did not change. While this would not cause any MCP servers to restart,
we would still go through all configured servers and call the
`command(...)` function on each installed MCP extension. This can cause
lots of logs to show up when an MCP server is not configured correctly.
Release Notes:
- N/A
Follow-up to #32852. This time we'll check if the debug session is
initialized before querying threads.
Release Notes:
- Fix Zed's debugger issuing threads request before it is allowed to do
so per DAP specification.
Closes https://github.com/zed-industries/zed/issues/33575
* Fixes inlay colors spoiled after document color displayed
* Optimizes the query pattern for large multi buffers
Release Notes:
- Fixed document colors issues with other inlays and multi buffers
Closes https://github.com/zed-industries/zed/issues/33522
Turns out a bunch of Zed requests were not checking their capabilities
correctly, due to odd copy-paste and due to default that assumed that
the capabilities are met.
Adjust the code, which includes the document colors, add the test on the
colors case.
Release Notes:
- Fixed excessive document colors requests for unrelated files
Follow-up of https://github.com/zed-industries/zed/pull/32490
The tool still looks like designed by professional developers, and still
may change its UX based on the internal feedback.
Release Notes:
- N/A
## Context
To support inline values a language will have to implement their own
provider trait that walks through tree sitter nodes. This is overly
complicated, hard to accurately implement for each language, and lacks
proper extension support.
This PR switches to a singular inline provider that uses a language's
`debugger.scm` query field to capture variables and scopes. The inline
provider is able to use this information to generate inlays that take
scope into account and work with any language that defines a debugger
query file.
### Todos
- [x] Implement a utility test function to easily test inline values
- [x] Generate inline values based on captures
- [x] Reimplement Python, Rust, and Go support
- [x] Take scope into account when iterating through variable captures
- [x] Add tests for Go inline values
- [x] Remove old inline provider code and trait implementations
Release Notes:
- debugger: Generate inline values based on a language debugger.scm file
This PR addresses to fix (#31308) a race condition where auto-indent (in
buffer.cs) and on-type-formatting (in lsp_store.rs) concurrently
calculate indentation using the same buffer snapshot.
Previous Solution (Abandoned):
https://github.com/zed-industries/zed/pull/31340
Final Solution:
Delay applying on-type-formatting until auto-indent is complete.
Issue:
If AutoindentMode finishes first, formatting works correctly. If
"Formatting on typing" starts before AutoindentMode completes, it
results in double indentation.
Closes#31308
Release Notes:
- Fixed a race condition resulting in incorrect buffer contents when combining auto-indent and on-type-formatting
Before this PR force quitting Zed would leave hanging debug adapter
processes and not allow debug adapters to clean up their sessions
properly.
This PR fixes this problem by sending a disconnect/terminate to all
debug adapters and force shutting down their processes after they
respond.
Co-authored-by: Cole Miller \<cole@zed.dev\>
Release Notes:
- debugger: Shutdown and clean up debug processes when force quitting
Zed
---------
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Custom arguments replace any arguments that we normally pass to the DAP.
For interpreted languages, they are passed to the interpreter after the
DAP path or module. They can be combined with a custom binary, or you
can omit `dap.binary` and just customize the arguments to the DAPs we
download.
This doesn't take care of updating the extension API to support custom
arguments.
Release Notes:
- debugger: Implemented support for passing custom arguments to a debug
adapter binary using the `dap.args` setting.
- debugger: Fixed not being able to use the `dap` setting in
`.zed/settings.json`.
I don't have a concrete misbehavior from it, but this update of
`insert_range` doesn't make sense for two reasons:
* If the resolved completion doesn't have a new `text_edit` it would
clear out the `insert_range`.
* It doesn't update the completion if it has already been resolved,
except this update of `insert_range` happened before that.
Guessing it was written this way because this field needed to only be
mutated within the `CompletionSource::Lsp` case and this was a
convenient match below.
Release Notes:
- N/A
Co-authored-by: Smit <smit@zed.dev>
Closes#33106
Instead of directly using `filter_text` in `StringMatchCandidate`, which
yields better results for fuzzy matching but messes up with highlighting
letters in bold, as `positions` list generated by fuzzy crate are now of
`filter_text` and not `label` shown to the user.
This PR fixes it by keeping use of `filter_range` in
`StringMatchCandidate`, which is range w.r.t to `label` shown to user.
And actually generating this `filter_range` at source by using
`filter_range` if exists.
- [x] Tests
Release Notes:
- Fixed issue where incorrect letters are marked as bold in completions.
- [x] Show disabled MCP servers in the list so you can enable them again
- [x] If MCP is not present in the settings, add it
Closes #ISSUE
Release Notes:
- agent: Allow to enable/disable context servers permanently in the
agent configuration view
---------
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
### This PR introduces support for adding watchers to specific
expressions (such as variable names or evaluated expressions).
This feature is useful in scenarios where many variables are in scope,
but only a few are of interest—especially when tracking variables that
change frequently. By allowing users to add watchers, it becomes easier
to monitor the values of selected expressions across stack frames
without having to sift through a large list of variables.
https://github.com/user-attachments/assets/c49b470a-d912-4182-8419-7406ba4c8f1e
------
**TODO**:
- [x] make render variable code reusable for render watch method
- [x] use SharedString for watches because of a lot of cloning
- [x] add tests
- [x] basic test
- [x] test step debugging
Release Notes:
- Debugger Beta: Add support for variable watchers
---------
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Anthony <anthony@zed.dev>
Variable list wasn't notified when a set variable value request was
successfully. This caused the variable list and inline values to show
stale data in some cases, which this PR fixes.
Release Notes:
- debugger: Fix bug where setting a variable's value wouldn't update the
variable list or inline values
- [x] Pass in cwd
- [x] Use the appropriate package manager
- [x] Don't mix up package.json and composer.json
Release Notes:
- debugger: Fixed wrong arguments being passed to the DAP when debugging
scripts from package.json.