This move was done so debug configs could use path resolution, and
saving a configuration from the new session modal wouldn't resolve paths
beforehand.
I also added an integration test to make sure path resolution happens
from an arbitrary config. The test was placed under the new session
modal directory because it has to do with starting a session, and that's
what the new session modal typically does, even if it's implicitly used
in the test.
In the future, I plan to add more tests to the new session modal too.
Release Notes:
- debugger beta: Allow configs from debug.json to resolve paths
@Anthony-Eid I'm pretty sure this maintains the behavior of #30680, and
I added some tests to be sure.
Release Notes:
- `~` now expands to the home directory in the debugger launch modal.
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
This includes the following data:
- Where we spawned the session from (gutter, scenario list, custom form
filled by the user)
- Which debug adapter was used
- Which dock the debugger is in
Closes #ISSUE
Release Notes:
- debugger: Added telemetry for new session experience that includes
data about:
- How a session was spawned (gutter, scenario list or custom form)
- Which debug adapter was used
- Which dock the debugger is in
---------
Co-authored-by: Joseph T. Lyons <JosephTLyons@gmail.com>
This PR allows DAPs to define their own schema so users can see
completion items when editing their debug.json files.
Users facing this aren’t the biggest chance, but behind the scenes, this
affected a lot of code because we manually translated common fields from
Zed's config format to be adapter-specific. Now we store the raw JSON
from a user's configuration file and just send that.
I'm ignoring the Protobuf CICD error because the DebugTaskDefinition
message is not yet user facing and we need to deprecate some fields in
it.
Release Notes:
- debugger beta: Show completion items when editing debug.json
- debugger beta: Breaking change, debug.json schema now relays on what
DAP you have selected instead of always having the same based values.
---------
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Cole Miller <cole@zed.dev>
- Remove the modules list and loaded sources list from the default
layout
- Move the console to the center pane so it's visible initially
Release Notes:
- Debugger Beta: changed the default layout of the debugger panel,
hiding the modules list and loaded sources list by default and making
the console more prominent.
---------
Co-authored-by: Remco Smits <djsmits12@gmail.com>
- Add missing handler for `debugger::Continue` so `f5` works
- Add bindings based on VS Code for `debugger::Restart` and
`debug_panel::ToggleFocus`
- Remove breakpoint-related buttons from the debug panel's top strip,
and surface the bindings for `editor::ToggleBreakpoint` in gutter
tooltip instead
Release Notes:
- Debugger Beta: Added keybindings for `debugger::Continue`,
`debugger::Restart`, and `debug_panel::ToggleFocus`.
- Debugger Beta: Removed breakpoint-related buttons from the top of the
debug panel.
- Compatibility note: on Linux, `ctrl-shift-d` is now bound to
`debug_panel::ToggleFocus` by default, instead of
`editor::DuplicateLineDown`.
Makes it possible to open and navigate these menus from the keyboard.
I also removed the eager previewing behavior for the thread picker,
which was buggy and came with a jarring layout shift.
Release Notes:
- Debugger Beta: Added the `debugger: open thread picker` and `debugger:
open session picker` actions.
https://github.com/zed-industries/zed/issues/30972 brought up another
case where our context is not enough to track the actual source of the
issue: we get a general top-level error without inner error.
The reason for this was `.ok_or_else(|| anyhow!("failed to read HEAD
SHA"))?; ` on the top level.
The PR finally reworks the way we use anyhow to reduce such issues (or
at least make it simpler to bubble them up later in a fix).
On top of that, uses a few more anyhow methods for better readability.
* `.ok_or_else(|| anyhow!("..."))`, `map_err` and other similar error
conversion/option reporting cases are replaced with `context` and
`with_context` calls
* in addition to that, various `anyhow!("failed to do ...")` are
stripped with `.context("Doing ...")` messages instead to remove the
parasitic `failed to` text
* `anyhow::ensure!` is used instead of `if ... { return Err(...); }`
calls
* `anyhow::bail!` is used instead of `return Err(anyhow!(...));`
Release Notes:
- N/A
This PR prevents the debug panel pane context menu from showing when you
click your secondary mouse button in **stackframe**, **breakpoint** and
**module** list entries.
Release Notes:
- N/A
- Switch stack frame list and module list to `UniformList` to access
scrolling behavior
- Implement `menu::` navigation actions
Release Notes:
- Debugger Beta: Added support for menu navigation actions (`ctrl-n`,
`ctrl-p`, etc.) in the stack frame list and module list.
The first panic was caused by an unwrap that assumed a file would always
have a root syntax node.
The second was caused by a double lease panic when clicking enter in the
debug console while there was a completion menu open
Release Notes:
- N/A
- Focus the console's query bar (if it exists) when focusing the console
- Fix incorrect focus handles used for the console and terminal at the
`Subview` level
Release Notes:
- N/A
Co-authored-by: Piotr <piotr@zed.dev>
Co-authored-by: Anthony <anthony@zed.dev>
We attempt to resolve the language name in this order
1. Based on debug adapter if they're for a singular language e.g. Delve
2. File extension if it exists
3. If a language name exists within a debug scenario's label
In the future I want to use locators to also determine the language as
well and refresh scenario list when a new scenario has been saved
Release Notes:
- N/A
This PR adds the ability to expand a debugger stack trace into a multi
buffer and view each frame as it's own excerpt.
Release Notes:
- N/A
---------
Co-authored-by: Remco Smits <djsmits12@gmail.com>
- A loading icon is displayed while a scenario is being saved
- Saving a scenario doesn't take you to debug.json unless a user clicks
on the arrow icons that shows up after a successful save
- An error icon where show when a scenario fails to save
- Fixed a bug where scenario's failed to save when there was no .zed
directory in the user's worktree
Release Notes:
- N/A
Release Notes:
- debugger: allow setting env vars and arguments on the launch command.
---------
Co-authored-by: Cole Miller <m@cole-miller.net>
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This PR simplifies the new session modal by flattening its three modes
and updating the UI to be less noisy. The new UI also defaults to the
Debug Scenario Picker, and allows users to save debug scenarios created
in the UI to the active worktree's .zed/debug.json file.
Release Notes:
- N/A
## Context
This PR improves the accuracy of our inline values for Rust/Python. It
does this by only adding inline value hints to the last valid use of a
variable and checking whether variables are valid within a given scope
or not.
We also added tests for Rust/Python inline values and inline values
refreshing when stepping in a debug session.
### Future tasks
1. Handle functions that have inner functions defined within them.
2. Add inline values to variables that were used in inner scopes but not
defined in them.
3. Move the inline value provider trait and impls to the language trait
(or somewhere else).
4. Use Semantic tokens as the first inline value provider and fall back
to tree sitter
5. add let some variable statement, for loops, and function inline value
hints to Rust.
6. Make writing tests more streamlined.
6.1 We should be able to write a test by only passing in variables,
language, source file, expected result, and stop position to a function.
7. Write a test that has coverage for selecting different stack frames.
co-authored-by: Remco Smits \<djsmits12@gmail.com\>
Release Notes:
- N/A
---------
Co-authored-by: Remco Smits <djsmits12@gmail.com>
- Languages now define their preferred debuggers in `config.toml`.
- `LanguageRegistry` now exposes language config even for languages that
are not yet loaded. This necessitated extension registry changes (we now
deserialize config.toml of all language entries when loading new
extension index), but it should be backwards compatible with the old
format. /cc @maxdeviant
Release Notes:
- N/A
---------
Co-authored-by: Anthony Eid <hello@anthonyeid.me>
Co-authored-by: Remco Smits <djsmits12@gmail.com>
Co-authored-by: Anthony <anthony@zed.dev>
There were two bugs that caused user-defined debug scenarios from being
able to run a build task.
1. DebugRequest would be deserialized to `Attach` even when `process_id`
wasn't defined in a user's configuration file. This has been fixed by
adding our own deserializer that defaults to None if there are no fields
present instead of `Attach`, and I added tests to prevent regressions.
2. Debug scenario resolve phase never got the active buffer when
spawning a debug session from the new session modal. This has been
worked around by passing in the worktree_id of a debug scenario in the
scenario picker and the active worktree_id otherwise.
Release Notes:
- N/A
Currently contains the pre-work of making sessions creatable without a
definition, but still need to change the spawn in terminal
to use the running session
Release Notes:
- N/A
---------
Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
To-dos:
- [x] Expose the command to defend against cases where that's just super
long
- [x] Tackle the vertical scroll conflict with panel scroll
- [x] Reduce default font-size
Release Notes:
- N/A
---------
Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: Agus Zubiaga <hi@aguz.me>
Nathan here: I also tacked on a bunch of UI refinement.
Release Notes:
- Introduced the ability to follow the agent around as it reads and
edits files.
---------
Co-authored-by: Nathan Sobo <nathan@zed.dev>
Co-authored-by: Max Brunsfeld <maxbrunsfeld@gmail.com>
I also moved the breakpoint store to session from local mode, because
both remote/local modes will need the ability to remove active debug
lines.
Release Notes:
- N/A