Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(debug): debug quick access, stop reveal, first scope expansion

rokartur61676afca737
diff --git a/native/crates/app/src/debug/configuration.rs b/native/crates/app/src/debug/configuration.rs
index c17b5c36b25..7d3c1032ab0 100644
--- a/native/crates/app/src/debug/configuration.rs
+++ b/native/crates/app/src/debug/configuration.rs
@@ -55,7 +55,7 @@ impl Launch {
}
/// debugUtils.ts `getVisibleAndSorted` comparison: entries with a presentation first, then by group and order.
-fn compare_presentation(first: &Value, second: &Value) -> std::cmp::Ordering {
+pub fn compare_presentation(first: &Value, second: &Value) -> std::cmp::Ordering {
use std::cmp::Ordering;
match (first.is_object(), second.is_object()) {
(false, false) => return Ordering::Equal,
diff --git a/native/crates/app/src/workbench.rs b/native/crates/app/src/workbench.rs
index 8d4115bcd55..774e0ef08bb 100644
--- a/native/crates/app/src/workbench.rs
+++ b/native/crates/app/src/workbench.rs
@@ -615,6 +615,7 @@ impl Render for Workbench {
self.refresh_selection_highlights(window);
self.refresh_document_highlights(window, cx);
self.refresh_outline_pane(cx);
+ self.mark_variables_view_created();
self.update_webview_panels(window, cx);
self.update_notebook_views(window, cx);
self.update_diff_editor();
diff --git a/native/crates/app/src/workbench/debug_commands.rs b/native/crates/app/src/workbench/debug_commands.rs
index 4072d03134c..e54be7498a2 100644
--- a/native/crates/app/src/workbench/debug_commands.rs
+++ b/native/crates/app/src/workbench/debug_commands.rs
@@ -221,7 +221,7 @@ impl Workbench {
self.commands.register("workbench.action.debug.configure", |workbench, _, window, cx| workbench.open_launch_json(window, cx));
self.commands.register("debug.addConfiguration", |workbench, _, window, cx| workbench.open_launch_json(window, cx));
self.commands.register("workbench.action.debug.selectandstart", |workbench, _, window, cx| {
- workbench.select_and_start(window, cx);
+ workbench.show_quick_access(super::quick_access::start_debug::PREFIX, false, false, window, cx);
Outcome::done()
});
}
@@ -452,6 +452,11 @@ impl Workbench {
fn open_launch_json(&mut self, window: &mut Window, cx: &mut Context<Self>) -> Outcome {
let (folder, _) = self.selected_launch();
let Some(folder) = folder else { return Outcome::error("Open a folder or workspace to configure debugging.") };
+ self.open_folder_launch_json(&folder, window, cx)
+ }
+
+ /// launch.ts `openConfigFile` of a folder's launch.json, created when missing.
+ pub(super) fn open_folder_launch_json(&mut self, folder: &std::path::Path, window: &mut Window, cx: &mut Context<Self>) -> Outcome {
let file = config::service::folder_config_dir(&folder).join("launch.json");
if !file.exists() {
let content = "{\n\t// Use IntelliSense to learn about possible attributes.\n\t// Hover to view descriptions of existing attributes.\n\t// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387\n\t\"version\": \"0.2.0\",\n\t\"configurations\": []\n}";
@@ -464,32 +469,6 @@ impl Workbench {
Outcome::done()
}
- /// debugCommands.ts SELECT_AND_START: pick a launch configuration, then start it.
- fn select_and_start(&mut self, window: &mut Window, cx: &mut Context<Self>) {
- let mut choices: Vec<(Option<PathBuf>, String)> = Vec::new();
- for folder in self.workspace_folders() {
- for name in self.folder_launch(&folder).configuration_names() {
- choices.push((Some(folder.clone()), name));
- }
- }
- let several = self.workspace_folders().len() > 1;
- let items = choices
- .iter()
- .map(|(folder, name)| (name.clone(), several.then(|| folder.as_ref().and_then(|folder| folder.file_name()).map(|name| name.to_string_lossy().into_owned())).flatten()))
- .collect();
- let picked = self.debug_pick("Select a launch configuration", items, window, cx);
- cx.spawn_in(window, async move |this, cx| {
- let Some(index) = picked.await.ok().flatten().and_then(|index| index.parse::<usize>().ok()) else { return };
- let (folder, name) = choices[index].clone();
- let _ = this.update_in(cx, |workbench, window, cx| {
- workbench.debug.selected = Some((folder.clone(), name.clone()));
- workbench.store_selected_configuration();
- drop(workbench.start_debugging(folder, json!(name), json!({ "startedByUser": true }), DebugTasks::PreLaunch, window, cx));
- });
- })
- .detach();
- }
-
/// debug.ts context keys.
pub(super) fn debug_context(&self, window: &Window, context: &mut HashMap<String, Value>) {
let state = self.debug.state();
@@ -722,4 +701,39 @@ mod tests {
});
assert_eq!(step(cx), json!("instruction"));
}
+
+ #[gpui::test]
+ fn a_stop_on_a_line_in_view_keeps_the_scroll(cx: &mut TestAppContext) {
+ let app_root = Path::new(env!("VSCODE_SRC")).to_path_buf();
+ let themes = exthost::scan::scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap();
+ let theme = crate::theme::load_theme(&[themes], "Dark Modern").unwrap();
+ let dir = std::env::temp_dir().join(format!("code-gpui-stop-scroll-{}", std::process::id()));
+ std::fs::create_dir_all(&dir).unwrap();
+ let file = dir.join("a.js");
+ std::fs::write(&file, "x\n".repeat(100)).unwrap();
+ let (sender, _host) = std::sync::mpsc::channel();
+ let (workbench, cx) = cx.add_window_view(|_, cx| Workbench::new(theme, app_root.clone(), None, crate::languages::Languages::new(&[]), crate::default_settings(), crate::host_sync::HostSync::new(sender), cx));
+ let viewport = crate::editor::Viewport { width: 800., height: 100., char_width: 8., ..Default::default() };
+ let scroll_top_at_stop = |line: u32, laid_out: bool, cx: &mut gpui::VisualTestContext| {
+ workbench.update_in(cx, |workbench, window, cx| {
+ workbench.editors.viewport = if laid_out { viewport } else { Default::default() };
+ let mut session = Session::new("s".into(), 1, json!({ "name": "s", "type": "node", "request": "launch" }), json!({}), None, json!({}));
+ session.set_threads(&[json!({ "id": 1, "name": "main" })]);
+ let frame = crate::debug::session::StackFrame { id: 3, source: json!({ "path": file.to_string_lossy() }), line, column: 1, ..Default::default() };
+ session.thread_mut(1).unwrap().frames = vec![frame];
+ workbench.debug.sessions = vec![session];
+ let focus = super::super::debug_service::DebugFocus { session: Some("s".into()), thread: Some(1), frame: Some(3) };
+ workbench.set_debug_focus(focus, super::super::debug_service::Reveal::TakingFocus, window, cx);
+ if !laid_out {
+ workbench.editor_laid_out(viewport, None, cx);
+ }
+ workbench.editors.active().unwrap().scroll.top
+ })
+ };
+ assert_eq!(scroll_top_at_stop(5, true, cx), 0., "line 5 is in the 100px view");
+ assert!(scroll_top_at_stop(80, true, cx) > 0., "line 80 is outside it and is centered");
+ workbench.update(cx, |workbench, _| workbench.editors.active_mut().unwrap().scroll.top = 0.);
+ assert_eq!(scroll_top_at_stop(5, false, cx), 0., "an editor not laid out yet reveals at its size");
+ std::fs::remove_dir_all(dir).unwrap();
+ }
}
diff --git a/native/crates/app/src/workbench/debug_inline_values/tests.rs b/native/crates/app/src/workbench/debug_inline_values/tests.rs
index d6134d4e2d4..58469f9c634 100644
--- a/native/crates/app/src/workbench/debug_inline_values/tests.rs
+++ b/native/crates/app/src/workbench/debug_inline_values/tests.rs
@@ -154,3 +154,29 @@ fn auto_shows_the_providers_values_in_column_order(cx: &mut TestAppContext) {
assert_eq!(shown(&workbench, cx), [(1, " first, B = 2, a = 1".into())]);
std::fs::remove_dir_all(dir).unwrap();
}
+
+/// variablesView.ts: a stop before the Variables view first shows leaves `Local` collapsed, as `renderBody` sets the
+/// input it finds; once the view exists, a focus change expands the first cheap scope.
+#[gpui::test]
+fn the_first_scope_expands_only_once_the_variables_view_exists(cx: &mut TestAppContext) {
+ let dir = std::env::temp_dir().join(format!("vsrustium-first-scope-{}", std::process::id()));
+ std::fs::create_dir_all(&dir).unwrap();
+ let file = dir.join("a.js");
+ std::fs::write(&file, "function f(a) {\n return a;\n}\n").unwrap();
+ let (workbench, host, cx) = workbench(cx, &file);
+ let focus = DebugFocus { session: Some("s".into()), thread: Some(1), frame: Some(9) };
+ let variables_requests_at_stop = |cx: &mut VisualTestContext| {
+ workbench.update_in(cx, |workbench, window, cx| workbench.set_debug_focus(focus.clone(), Reveal::No, window, cx));
+ cx.run_until_parked();
+ respond(&workbench, &host, &[("scopes", json!({ "scopes": [{ "name": "Local", "variablesReference": 4 }, { "name": "Global", "variablesReference": 5 }] }))], cx);
+ let requests: Vec<Value> = host.try_iter().filter(|message| message.method == "$sendDAMessage").map(|message| message.args[1].clone()).collect();
+ requests.iter().filter(|request| request["command"] == "variables").map(|request| request["arguments"]["variablesReference"].clone()).collect::<Vec<_>>()
+ };
+ assert_eq!(variables_requests_at_stop(cx), Vec::<Value>::new(), "the view has not shown yet");
+ workbench.update(cx, |workbench, cx| workbench.show_debug_view(cx));
+ cx.update(|window, cx| drop(window.draw(cx)));
+ assert_eq!(variables_requests_at_stop(cx), [json!(4)]);
+ workbench.update(cx, |workbench, cx| workbench.show_view_container(crate::workbench::view_locations::EXPLORER_CONTAINER, cx));
+ assert_eq!(variables_requests_at_stop(cx), [json!(4)], "a hidden view that showed once still expands");
+ std::fs::remove_dir_all(dir).unwrap();
+}
diff --git a/native/crates/app/src/workbench/debug_service.rs b/native/crates/app/src/workbench/debug_service.rs
index 2a565c7ebee..c7d63a1b540 100644
--- a/native/crates/app/src/workbench/debug_service.rs
+++ b/native/crates/app/src/workbench/debug_service.rs
@@ -934,6 +934,7 @@ impl Workbench {
self.send_stack_frame_focus();
self.debug.scopes.clear();
self.debug.children.clear();
+ self.debug_view.expand_first_scope = self.debug_view.variables_view_created || self.is_view_visible(super::debug_view::VARIABLES_VIEW);
self.disassembly_focus_changed(cx);
if reveal != Reveal::No && let Some(frame) = self.debug.focused_frame().cloned() {
self.reveal_stack_frame(&frame, reveal == Reveal::PreservingFocus, window, cx);
@@ -975,7 +976,9 @@ impl Workbench {
self.open_file(path.clone(), true, window, cx);
let line = frame.line.max(1) as usize;
let column = frame.column.max(1) as usize;
- self.select_range(&path, crate::anything_quick_access::TextRange { start_line_number: line, start_column: column, end_line_number: line, end_column: column }, cx);
+ let range = crate::anything_quick_access::TextRange { start_line_number: line, start_column: column, end_line_number: line, end_column: column };
+ // debugSource.ts `openInEditor`: `TextEditorSelectionRevealType.CenterIfOutsideViewport`.
+ self.select_range_revealed(&path, range, crate::editor::VerticalReveal::CenterIfOutsideViewport, cx);
// preserveFocus unless the editor had it: the stop must not take the focus from a view.
match previous_focus {
Some(previous) if !editor_focused => window.focus(&previous, cx),
@@ -1005,14 +1008,16 @@ impl Workbench {
let scopes = answer(scopes).await.unwrap_or_default();
let scopes: Vec<Variable> = scopes["scopes"].as_array().into_iter().flatten().map(Variable::from_dap).collect();
// variablesView.ts expands the first scope that is not expensive.
- let first = scopes.iter().find(|scope| !scope.expensive).map(|scope| scope.variables_reference);
- let _ = on_workbench(&this, cx, |workbench, _, cx| {
+ let first = scopes.iter().find(|scope| !scope.expensive).map(|scope| (format!("scope/{}", scope.name), scope.variables_reference));
+ let _ = on_workbench(&this, cx, |workbench, window, cx| {
workbench.debug.scopes = scopes;
+ if let Some((key, reference)) = first
+ && workbench.row_expanded(&key, workbench.debug_view.expand_first_scope)
+ {
+ workbench.fetch_children(&session_id, reference, window, cx);
+ }
cx.notify();
});
- if let Some(reference) = first {
- let _ = on_workbench(&this, cx, |workbench, window, cx| workbench.fetch_children(&session_id, reference, window, cx));
- }
for (id, reply) in watches {
let mut value = evaluation_result(String::new(), answer(reply).await);
// debugModel.ts `evaluateExpression` without `keepLazyVars`.
diff --git a/native/crates/app/src/workbench/debug_view.rs b/native/crates/app/src/workbench/debug_view.rs
index cd96dc6dc4d..2117142f830 100644
--- a/native/crates/app/src/workbench/debug_view.rs
+++ b/native/crates/app/src/workbench/debug_view.rs
@@ -56,6 +56,11 @@ pub struct DebugView {
pub widget_focus: gpui::FocusHandle,
pub toolbar_drag: Option<super::debug_toolbar::ToolbarDrag>,
pub exception: Option<super::exception_widget::ExceptionWidget>,
+ /// variablesView.ts builds its tree in `renderBody`, the first time the view shows.
+ pub variables_view_created: bool,
+ /// A focus change expands the first scope only when the Variables view exists by then: `renderBody` sets the
+ /// input it finds without expanding (variablesView.ts).
+ pub expand_first_scope: bool,
}
impl DebugView {
@@ -76,6 +81,8 @@ impl DebugView {
widget_focus: cx.focus_handle(),
toolbar_drag: None,
exception: None,
+ variables_view_created: false,
+ expand_first_scope: false,
}
}
}
@@ -84,6 +91,12 @@ const ROW_HEIGHT: f32 = 22.;
const INDENT: f32 = 8.;
impl Workbench {
+ pub(super) fn mark_variables_view_created(&mut self) {
+ if !self.debug_view.variables_view_created && self.is_view_visible(VARIABLES_VIEW) {
+ self.debug_view.variables_view_created = true;
+ }
+ }
+
/// `CONTEXT_DEBUG_UX` `simple`: no session and no launch configuration, the welcome view instead of the debug views.
pub(super) fn debug_ux_simple(&self) -> bool {
self.debug.state() == State::Inactive && self.debug.sessions.is_empty() && !self.workspace_folders().iter().any(|folder| !self.folder_launch(folder).configurations.is_empty())
@@ -462,7 +475,7 @@ impl Workbench {
let first_cheap = self.debug.scopes.iter().position(|scope| !scope.expensive);
for (index, scope) in self.debug.scopes.iter().enumerate() {
let key = format!("scope/{}", scope.name);
- let expanded = self.row_expanded(&key, Some(index) == first_cheap);
+ let expanded = self.row_expanded(&key, self.debug_view.expand_first_scope && Some(index) == first_cheap);
let reference = scope.variables_reference;
let row_key = key.clone();
let session_id = session.clone();
@@ -512,7 +525,7 @@ impl Workbench {
self.debug_view.selected.as_deref() == Some(key)
}
- fn row_expanded(&self, key: &str, default: bool) -> bool {
+ pub(super) fn row_expanded(&self, key: &str, default: bool) -> bool {
if self.debug_view.expanded.contains(key) {
return true;
}
diff --git a/native/crates/app/src/workbench/quick_access.rs b/native/crates/app/src/workbench/quick_access.rs
index ef875fdfc1f..db099ebc7ac 100644
--- a/native/crates/app/src/workbench/quick_access.rs
+++ b/native/crates/app/src/workbench/quick_access.rs
@@ -66,20 +66,22 @@ pub enum Accept {
WorkspaceSymbol(workspace_symbols::WorkspaceSymbol),
/// A `view ` pick.
View(views::ViewTarget),
+ Debug(start_debug::DebugPick),
Nothing,
}
/// `getHelpPicks`: the help entries with a `commandCenterOrder`, by that order, of the providers the port has
-/// (Search for Text, Go to Symbol, Start Debugging and Run Task wait for theirs), with `commandCenterLabel`.
-const HELP_ENTRIES: [(&str, Provider, Option<&str>); 4] = [
+/// (Search for Text, Go to Symbol and Run Task wait for theirs), with `commandCenterLabel`.
+const HELP_ENTRIES: [(&str, Provider, Option<&str>); 5] = [
("Go to File", Provider::Files, Some("workbench.action.quickOpen")),
("Show and Run Commands", Provider::Commands, Some("workbench.action.showCommands")),
("Go to Symbol in Editor", Provider::Symbols, Some("workbench.action.gotoSymbol")),
+ ("Start Debugging", Provider::Debug, Some("workbench.action.debug.selectandstart")),
("More", Provider::Help, None),
];
/// The `helpEntries` of each provider the port has, as the `?` picker lists them: prefix, description, command.
-const PROVIDER_HELP: [(&str, &str, Option<&str>); 12] = [
+const PROVIDER_HELP: [(&str, &str, Option<&str>); 13] = [
("", "Go to File", Some("workbench.action.quickOpen")),
(goto_line::GO_TO_LINE_PREFIX, "Go to Line/Column", Some("workbench.action.gotoLine")),
(goto_line::GO_TO_OFFSET_PREFIX, "Go to Offset", Some("workbench.action.gotoOffset")),
@@ -88,6 +90,7 @@ const PROVIDER_HELP: [(&str, &str, Option<&str>); 12] = [
(goto_symbol::PREFIX_BY_CATEGORY, "Go to Symbol in Editor by Category", None),
(workspace_symbols::PREFIX, "Go to Symbol in Workspace", Some("workbench.action.showAllSymbols")),
(views::PREFIX, "Open View", Some("workbench.action.openView")),
+ (start_debug::PREFIX, "Start Debugging", Some("workbench.action.debug.selectandstart")),
(terminal_quick_access::TERMINAL_PREFIX, "Show All Opened Terminals", Some("workbench.action.quickOpenTerm")),
(editor_quick_access::ACTIVE_GROUP_PREFIX, "Show Editors in Active Group by Most Recently Used", Some("workbench.action.showEditorsInActiveGroup")),
(editor_quick_access::ALL_PREFIX, "Show All Opened Editors By Appearance", Some("workbench.action.showAllEditors")),
@@ -105,6 +108,7 @@ enum Provider {
Symbols,
WorkspaceSymbols,
Views,
+ Debug,
/// The `edt` providers, by their prefix.
Editors(&'static str),
}
@@ -125,6 +129,7 @@ impl Provider {
_ if value.starts_with(goto_symbol::PREFIX) => Provider::Symbols,
_ if value.starts_with(workspace_symbols::PREFIX) => Provider::WorkspaceSymbols,
_ if value.starts_with(views::PREFIX) => Provider::Views,
+ _ if value.starts_with(start_debug::PREFIX) => Provider::Debug,
_ => Provider::Files,
}
}
@@ -141,6 +146,7 @@ impl Provider {
Provider::Symbols => goto_symbol::PREFIX,
Provider::WorkspaceSymbols => workspace_symbols::PREFIX,
Provider::Views => views::PREFIX,
+ Provider::Debug => start_debug::PREFIX,
}
}
@@ -155,6 +161,7 @@ impl Provider {
Provider::Symbols => Some(goto_symbol::PLACEHOLDER.into()),
Provider::WorkspaceSymbols => Some(workspace_symbols::PLACEHOLDER.into()),
Provider::Views => Some(views::PLACEHOLDER.into()),
+ Provider::Debug => Some(start_debug::PLACEHOLDER.into()),
}
}
}
@@ -327,6 +334,10 @@ impl Workbench {
let (entries, accepts) = self.view_picks(&filter);
Some((entries, accepts, false))
}
+ Provider::Debug => {
+ let (entries, accepts) = self.debug_picks(&filter);
+ Some((entries, accepts, false))
+ }
Provider::GotoLine | Provider::GotoOffset => Some((Vec::new(), self.goto_line_picks(id, &value, cx), false)),
};
let input = self.quick_inputs.get_mut(id).expect("checked above");
@@ -486,6 +497,11 @@ impl Workbench {
input.remove_item(handle);
}
}
+ Event::TriggerItemButton(handle, _, _) if matches!(self.quick_access_pick(id, handle), Some(Accept::Debug(_))) => {
+ let Some(Accept::Debug(pick)) = self.quick_access_pick(id, handle) else { return };
+ self.hide_quick_input_by_id(id, window, cx);
+ self.trigger_debug_pick(pick, window, cx);
+ }
Event::TriggerItemButton(handle, button, _) if matches!(self.quick_access_pick(id, handle), Some(Accept::Terminal(_))) => {
let Some(Accept::Terminal(terminal)) = self.quick_access_pick(id, handle) else { return };
if self.trigger_terminal_pick_button(terminal, button, window, cx)
@@ -550,6 +566,7 @@ impl Workbench {
Accept::Symbol(target) => return self.go_to_symbol(&target, in_background, false, window, cx),
Accept::WorkspaceSymbol(symbol) => return self.open_workspace_symbol(symbol, in_background, window, cx),
Accept::View(target) => return self.accept_view_pick(target, window, cx),
+ Accept::Debug(pick) => return self.accept_debug_pick(pick, window, cx),
Accept::Nothing => return,
};
self.quick_access.history.push(&id);
@@ -627,6 +644,7 @@ fn show_command_error(label: &str, error: &Value, window: &mut Window, cx: &mut
mod goto_line;
pub(super) mod goto_symbol;
+pub(super) mod start_debug;
mod views;
mod workspace_symbols;
diff --git a/native/crates/app/src/workbench/quick_access/start_debug.rs b/native/crates/app/src/workbench/quick_access/start_debug.rs
new file mode 100644
index 00000000000..e613feeff75
--- /dev/null
+++ b/native/crates/app/src/workbench/quick_access/start_debug.rs
@@ -0,0 +1,133 @@
+//! debugQuickAccess.ts `StartDebugQuickAccessProvider`: `debug ` lists the launch configurations, the most recent
+//! first, and an Add Configuration pick per folder. Debug: Select and Start Debugging shows it.
+
+use std::path::PathBuf;
+
+use gpui::{Context, Window};
+use serde_json::{Value, json};
+
+use super::Accept;
+use crate::debug::configuration::compare_presentation;
+use crate::filters::matches_fuzzy_separate;
+use crate::quick_input::{Button, Entry, Item};
+use crate::workbench::Workbench;
+use crate::workbench::debug_task_runner::DebugTasks;
+
+/// debugCommands.ts `DEBUG_QUICK_ACCESS_PREFIX`.
+pub const PREFIX: &str = "debug ";
+pub const PLACEHOLDER: &str = "Type the name of a launch configuration to run.";
+
+/// What a `debug ` pick does.
+#[derive(Clone, Debug)]
+pub enum DebugPick {
+ /// A launch configuration of the folder, started on accept; its gear button opens the folder's launch.json.
+ Launch { folder: PathBuf, name: String },
+ AddConfiguration(PathBuf),
+}
+
+impl Workbench {
+ /// `_getPicks`.
+ pub(super) fn debug_picks(&self, filter: &str) -> (Vec<Entry>, Vec<Accept>) {
+ let (mut entries, mut accepts) = (Vec::new(), Vec::new());
+ if self.debug.debuggers.is_empty() {
+ // pickerQuickAccess.ts: the `noResultsPick` only for a typed filter.
+ if !filter.is_empty() {
+ entries.push(Entry::Item(Item { handle: 0, label: "No matching launch configurations".into(), pickable: true, ..Item::default() }));
+ accepts.push(Accept::Nothing);
+ }
+ return (entries, accepts);
+ }
+ let multi_root = self.workspace().is_some_and(|workspace| workspace.file.is_some());
+ let folder_name = |folder: &PathBuf| folder.file_name().map(|name| name.to_string_lossy().into_owned()).unwrap_or_default();
+ let folders = self.workspace_folders();
+ let mut configurations: Vec<(PathBuf, Value)> = Vec::new();
+ for folder in &folders {
+ let launch = self.folder_launch(folder);
+ for config in launch.configurations.into_iter().chain(launch.compounds) {
+ if config["presentation"]["hidden"] != true && config["name"].is_string() {
+ configurations.push((folder.clone(), config));
+ }
+ }
+ }
+ configurations.sort_by(|(_, first), (_, second)| compare_presentation(&first["presentation"], &second["presentation"]));
+
+ let (selected_folder, selected_name) = self.selected_launch();
+ let mut most_recent = None;
+ entries.push(Entry::Separator(Some("launch.json".into())));
+ let mut last_group = None;
+ for (folder, config) in configurations {
+ let name = config["name"].as_str().expect("filtered above").to_owned();
+ let Some(label_highlights) = matches_fuzzy_separate(filter, &name) else { continue };
+ let item = Item {
+ handle: 0,
+ label: name.clone(),
+ description: multi_root.then(|| folder_name(&folder)),
+ label_highlights,
+ pickable: true,
+ buttons: vec![Button { handle: 0, codicon: Some("gear".into()), tooltip: Some("Configure Launch Configuration".into()), ..Button::default() }],
+ ..Item::default()
+ };
+ let accept = Accept::Debug(DebugPick::Launch { folder: folder.clone(), name: name.clone() });
+ if selected_name.as_ref() == Some(&name) && selected_folder.as_ref() == Some(&folder) {
+ most_recent = Some((item, accept));
+ continue;
+ }
+ let group = config["presentation"]["group"].as_str().map(str::to_owned);
+ if last_group != group {
+ entries.push(Entry::Separator(None));
+ last_group = group;
+ }
+ entries.push(Entry::Item(item));
+ accepts.push(accept);
+ }
+ if let Some((item, accept)) = most_recent {
+ entries.splice(0..0, [Entry::Separator(Some("Most Recent".into())), Entry::Item(item)]);
+ accepts.insert(0, accept);
+ }
+
+ if !folders.is_empty() {
+ entries.push(Entry::Separator(Some("configure".into())));
+ }
+ for folder in folders {
+ let label = match multi_root {
+ true => format!("Add Config ({})...", folder_name(&folder)),
+ false => "Add Configuration...".to_owned(),
+ };
+ let label_highlights = matches_fuzzy_separate(filter, &label).unwrap_or_default();
+ entries.push(Entry::Item(Item { handle: 0, label, description: multi_root.then(|| folder_name(&folder)), label_highlights, pickable: true, ..Item::default() }));
+ accepts.push(Accept::Debug(DebugPick::AddConfiguration(folder)));
+ }
+
+ let mut handle = 0;
+ for entry in &mut entries {
+ if let Entry::Item(item) = entry {
+ item.handle = handle;
+ handle += 1;
+ }
+ }
+ (entries, accepts)
+ }
+
+ /// The pick's `accept`: `selectConfiguration`, then `startDebugging` with `startedByUser`.
+ pub(super) fn accept_debug_pick(&mut self, pick: DebugPick, window: &mut Window, cx: &mut Context<Self>) {
+ match pick {
+ DebugPick::Launch { folder, name } => {
+ self.debug.selected = Some((Some(folder.clone()), name.clone()));
+ self.store_selected_configuration();
+ drop(self.start_debugging(Some(folder), json!(name), json!({ "startedByUser": true }), DebugTasks::PreLaunch, window, cx));
+ }
+ // `ADD_CONFIGURATION_ID` with the folder's launch.json.
+ DebugPick::AddConfiguration(folder) => {
+ let outcome = self.open_folder_launch_json(&folder, window, cx);
+ super::show_failure("Add Configuration...".into(), outcome, window, cx);
+ }
+ }
+ }
+
+ /// The gear button's `trigger`: `launch.openConfigFile`, then `TriggerAction.CLOSE_PICKER`.
+ pub(super) fn trigger_debug_pick(&mut self, pick: DebugPick, window: &mut Window, cx: &mut Context<Self>) {
+ let DebugPick::Launch { folder, .. } = pick else { return };
+ let outcome = self.open_folder_launch_json(&folder, window, cx);
+ super::show_failure("Configure Launch Configuration".into(), outcome, window, cx);
+ }
+}
diff --git a/native/crates/app/src/workbench/quick_access/tests.rs b/native/crates/app/src/workbench/quick_access/tests.rs
index d1105999c11..c8b3922f164 100644
--- a/native/crates/app/src/workbench/quick_access/tests.rs
+++ b/native/crates/app/src/workbench/quick_access/tests.rs
@@ -178,6 +178,7 @@ fn help_lists_the_providers_and_shows_the_picked_one(cx: &mut TestAppContext) {
"@:|Go to Symbol in Editor by Category|[]",
r#"#|Go to Symbol in Workspace|[["⌘", "T"]]"#,
r#">|Show and Run Commands|[["⇧", "⌘", "P"]]"#,
+ "debug |Start Debugging|[]",
r#"edt |Show All Opened Editors By Appearance|[["⌥", "⌘", "Tab"]]"#,
"edt active |Show Editors in Active Group by Most Recently Used|[]",
"edt mru |Show All Opened Editors By Most Recently Used|[]",
@@ -284,6 +285,46 @@ fn the_view_picker_groups_views_by_container_and_opens_the_pick(cx: &mut TestApp
assert_eq!(workbench.read_with(cx, |workbench, _| (workbench.quick_inputs.current().is_none(), workbench.is_view_visible("workbench.view.search"))), (true, true), "the second pick, Search, opens");
}
+/// debugQuickAccess.ts: `debug ` lists the launch configurations, the selected one under Most Recent, a separator at
+/// each presentation group, then Add Configuration; a pick starts its configuration.
+#[gpui::test]
+fn the_debug_picker_lists_and_starts_the_launch_configurations(cx: &mut TestAppContext) {
+ let app_root = Path::new(env!("VSCODE_SRC")).to_path_buf();
+ let themes = scan_extension(&app_root.join("extensions/theme-defaults"), true).unwrap();
+ let theme = load_theme(&[themes], "Dark Modern").unwrap();
+ let dir = std::env::temp_dir().join(format!("code-gpui-debug-picker-{}", std::process::id()));
+ let folder = dir.join("folder");
+ std::fs::create_dir_all(folder.join(".vscode")).unwrap();
+ std::fs::create_dir_all(dir.join("User")).unwrap();
+ let launch = json!({ "configurations": [
+ { "name": "Launch app.js", "type": "node", "request": "launch" },
+ { "name": "Launch lazy.js", "type": "node", "request": "launch" },
+ { "name": "Grouped", "type": "node", "request": "launch", "presentation": { "group": "a" } },
+ { "name": "Hidden", "type": "node", "request": "launch", "presentation": { "hidden": true } },
+ ] });
+ std::fs::write(folder.join(".vscode/launch.json"), launch.to_string()).unwrap();
+ let workspace = config::workspace::Workspace::folder(folder.clone());
+ let settings = Arc::new(Mutex::new(config::service::Settings::load(config::registry::Registry::with_extensions(&[]), dir.join("User"), Some(workspace.clone()))));
+ let (workbench, cx) = cx.add_window_view(|_, cx| {
+ let mut workbench = Workbench::new(theme, app_root.clone(), Some(workspace), Languages::new(&[]), settings, HostSync::new(std::sync::mpsc::channel().0), cx);
+ workbench.load_keybindings(crate::keybindings::default_keybindings(&[]), dir.join("User/keybindings.json"));
+ workbench.debug.debuggers.push(crate::debug::configuration::Debugger { debug_type: "node".into(), contribution: json!({}), extension_id: "a.node".into() });
+ workbench.debug.selected = Some((Some(folder.clone()), "Launch app.js".into()));
+ workbench
+ });
+ cx.run_until_parked();
+
+ workbench.update_in(cx, |workbench, window, cx| drop(workbench.execute_command("workbench.action.debug.selectandstart", Vec::new(), window, cx)));
+ assert_eq!(workbench.read_with(cx, |workbench, _| workbench.quick_inputs.current().unwrap().placeholder.clone()).as_deref(), Some("Type the name of a launch configuration to run."));
+ assert_eq!(workbench.read_with(cx, labels), ["--Most Recent--Launch app.js", "----Grouped", "----Launch lazy.js", "--configure--Add Configuration..."]);
+ cx.simulate_input("lazy");
+ assert_eq!(workbench.read_with(cx, labels), ["--launch.json--Launch lazy.js", "--configure--Add Configuration..."]);
+ cx.simulate_keystrokes("enter");
+ cx.run_until_parked();
+ assert_eq!(workbench.read_with(cx, |workbench, _| (workbench.quick_inputs.current().is_none(), workbench.debug.selected.clone())), (true, Some((Some(folder.clone()), "Launch lazy.js".into()))), "the pick is selected and started");
+ std::fs::remove_dir_all(dir).unwrap();
+}
+
#[test]
fn removing_a_recently_used_pick_keeps_the_others() {
let mut input = crate::quick_input::QuickInput::new(1, crate::quick_input::Kind::QuickPick);
diff --git a/native/crates/app/src/workbench/quick_open.rs b/native/crates/app/src/workbench/quick_open.rs
index 23c7a142d64..e3b2d2321a5 100644
--- a/native/crates/app/src/workbench/quick_open.rs
+++ b/native/crates/app/src/workbench/quick_open.rs
@@ -333,6 +333,11 @@ impl Workbench {
/// `applyTextEditorOptions`: the selection, validated against the text, then revealed in the center.
pub(super) fn select_range(&mut self, path: &Path, range: TextRange, cx: &mut Context<Self>) {
+ self.select_range_revealed(path, range, VerticalReveal::Center, cx);
+ }
+
+ /// `applyTextEditorOptions` with a `selectionRevealType`.
+ pub(super) fn select_range_revealed(&mut self, path: &Path, range: TextRange, reveal: VerticalReveal, cx: &mut Context<Self>) {
let viewport = self.editors.viewport;
let Some(editor) = self.editors.active_mut().filter(|editor| editor.document().path == path) else { return };
let document = editor.document();
@@ -344,8 +349,15 @@ impl Workbench {
let selection = Selection { anchor: validate(range.start_line_number, range.start_column), head: validate(range.end_line_number, range.end_column) };
drop(document);
editor.set_selections(vec![selection]);
- editor.reveal_range(selection.start(), selection.end(), VerticalReveal::Center, viewport);
+ // A new editor has no size yet: it reveals once laid out, as an editor opens at its size upstream.
+ let before_layout = viewport.height == 0. && matches!(reveal, VerticalReveal::CenterIfOutsideViewport);
+ if !before_layout {
+ editor.reveal_range(selection.start(), selection.end(), reveal, viewport);
+ }
self.host.send_selection(editor, "code.navigation");
+ if before_layout {
+ self.editors.reveal_after_layout = Some(selection.start());
+ }
self.editor_scrolled(cx);
}
}
diff --git a/port/fixtures/ui-pair/debug/quick-access.json b/port/fixtures/ui-pair/debug/quick-access.json
new file mode 100644
index 00000000000..c57a3b73d76
--- /dev/null
+++ b/port/fixtures/ui-pair/debug/quick-access.json
@@ -0,0 +1,13 @@
+[
+ { "wait": 25000 },
+ { "hotkey": ["cmd", "p"], "foreground": true },
+ { "wait": 1000 },
+ { "type": "debug " },
+ { "wait": 1500 },
+ { "shot": "picker" },
+ { "type": "lazy" },
+ { "wait": 1000 },
+ { "key": "return", "foreground": true },
+ { "wait": 10000 },
+ { "shot": "stopped" }
+]
diff --git a/port/ledger.md b/port/ledger.md
index fedefcdbdaa..a27819303db 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -475,7 +475,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/contrib/commands | workbench contribution | M9 | verified | | runCommands (commands.rs register_run_commands): cargo test -p app commands::, argument checks, spread args, order, stop at a failure; argument errors and the failure notify (cargo test -p app run_commands_argument_errors_notify) |
| workbench/contrib/comments | workbench contribution | M13 | verified | | Done: a reply and an edit form per thread and comment, open together (commentReply.ts per CommentThreadWidget): cargo test -p app two_threads_keep_their_reply_forms_open_together; a zone sized by the drawn comment bodies: cargo test -p app a_wrapped_comment_body_grows_its_zone; next/previous thread and Focus Comment on Current Line focus the thread's comments (`commentFocused`, Up/Down between comments, Escape collapses and selects the range): cargo test -p app the_reached_thread_takes_the_focus. Done in diff editors: glyphs, commenting ranges (asked for every side of every multi diff file), range highlights and zones on both sides of the diff editor and of each multi diff file, the other side aligned by a diagonal fill (workbench/editor_view/diff_editor_view.rs, multi_diff_editor_view.rs, diff_editor.rs `additional_heights`): cargo test -p app diff comment; ui-pair `portComments.openDiff` modified, original and multi. Floating widgets on a diff's original side and on both sides of each multi diff file (comment_thread_floating.rs `FloatingHost`, multi_diff_editor_view.rs `multi_diff_floating_hosts`), with `FloatingWidgetRoom` growing a file below its last line (commentThreadFloatingWidgetRoom.ts, `FileDiff.room`): cargo test -p app floating room multi_diff; ui-pair `portComments.openDiff` original and multi with the floating style. Range decorations (commentThreadRangeDecorator.ts and the floating empty-range line, workbench/comment_thread_widget.rs `comment_range_highlights`): cargo test -p app comment_thread_floating. The floating thread style (`comments.thread.experimental.style: floating`; workbench/comment_thread_floating_layout.rs with commentThreadFloatingWidget.test.ts ported, workbench/comment_thread_floating.rs: placement beside the code or its lines in code order, the outline and connector, title drag, edge resize, double-click reset, the layout kept per thread, wheel to the editor): cargo test -p app comment_thread_floating, ui-pair steps-comment-floating.json (port/results/language-features.md Floating comment threads). Done: the Comments panel (workbench/comments_view.rs: resources, threads with author, relative time, first line, range and replies, the unresolved badge, a markdown preview's images as "Image: {alt}" (cargo test -p app a_markdown_comment_previews_its_first_rendered_block), the filter box with Show Resolved/Unresolved and Sort By, its history in the memento's `filterHistory`, Escape and Cmd+Down while `commentsFilterFocus` (cargo test -p app the_filter_keeps_its_history_and_escape_clears_it; no match highlights, as commentsTreeViewer.ts's renderers ignore the filter data), Collapse/Expand All, row selection and keys; hideIfEmpty; a thread row's `commentsView/commentThread/context` inline actions and context menu with the built-in Reply, which reveals the thread with its zone expanded and reply open: cargo test -p app the_thread_menu_replies_to_the_thread), the gutter glyph that toggles the thread (workbench/editor_view/comment_glyph.rs) and the thread widget (workbench/comment_thread_widget.rs: zone, state colors, head with `comments/commentThread/title` actions and Collapse, markdown comments with `code` spans on no `textCodeBlock.background` (cargo test -p app a_comment_s_code_span_draws_no_code_block_background), reply form with `comments/commentThread/context` buttons and Cmd+Enter), each comment (workbench/comment_node.rs: `comments/comment/title` actions, edit mode with `comments/comment/context` buttons, reactions and their picker), commenting ranges with the add glyph, Add Comment and template threads (workbench/commenting_ranges.rs), the comment commands (workbench/comment_navigation.rs: Collapse/Expand All, Expand Unresolved, Toggle Editor Commenting, Focus Comment on Current Line, Dismiss Comment, next/previous thread, commented range and commenting range, reached at the provider's columns unless it holds the cursor: cargo test -p app a_commenting_range_is_reached_at_its_columns_unless_it_holds_the_cursor) and the comments accessibility help: cargo test -p app comment; ui-pair port/results/language-features.md (Comments, Comment editing and commands); Escape keeps a new template open as the reference does (ui-pair steps-comment-escape-typed.json, cargo test -p app dismissing_a_new_template_keeps_it_open). The reply and edit inputs are code editors (simpleCommentEditor.ts: a `comment`-scheme markdown model, word wrap, no glyph margin, line numbers or folding, `scrollBeyondLastLine` false, 5 to 25 lines by `calculateEditorHeight`) that take the focus with `commentEditorFocused`, Cmd+Enter submits and Escape hides; the host gets the input's document and no text editor (workbench/comment_thread_widget.rs `open_comment_editor`, workbench/editor.rs `comment_editor`): cargo test -p app an_expanded_thread_shows_a_zone_and_replies_run_the_form_actions a_comment_switched_to_editing_runs_the_edit_actions; ui-pair steps-comment-reply-editor.json (reply-empty, reply-lines, reply-grown). Comments panel rows: 4px pane inset, 4px radius and the tree's indent guides as the Problems tree (cargo test -p app rows_sit_in_the_pane_s_inset_with_the_tree_s_indent_and_guides; ui-pair steps-comments.json: chevron, name and thread line at the reference's x and y) |
| workbench/contrib/customEditor | workbench contribution | M17 | verified | | Each editor of a custom text editor's resource, the one opened in another group and a split's copy, has a webview of its own (customEditorInput.ts: cargo test -p app each_group_s_custom_text_editor_has_its_own_webview); Opening a custom text editor with `options.selection` reveals it in the panel and leaves the text model's cursor (cargo test -p app a_custom_text_editor_s_navigation_drives_the_outline); A custom document open in another group moves to the active one, or with `supportsMultipleEditorsPerDocument` gets a second editor there (editorResolverService.ts `moveExistingEditorForResource`: cargo test -p app a_custom_document_open_in_another_group_moves_to_the_active_one a_custom_document_with_multiple_editors_opens_one_more_in_the_active_group); `workbench.editorAssociations` merged as editorResolverService.ts `getAllUserAssociationsForSetting`: the workspace's globs before the default's and user's (cargo test -p app a_workspace_association_wins_over_a_user_one_of_the_same_length); Reopen Editor With puts a closed custom or notebook editor's replacement in its place, pinned (editorGroupView.ts `replaceEditors`: cargo test -p app a_reopened_preview_keeps_its_tab_position); Two default editors for one resource warn once and remember the choice per extension glob (editorResolverService.ts `doHandleConflictingDefaults`: cargo test -p app two_default_editors_for_a_resource_ask_once_which_to_keep); the memento's custom editors until the extensions register (cargo test -p app markdown_editor_files_offer); editor resolution by `workbench.editorAssociations` and contributed selectors (editorResolverService.ts ranks), Reopen Editor With picker (`reopenActiveEditorWith`, `workbench.action.reopenWithEditor`), `_workbench.open`, `_workbench.openWith`; `FIXTURE=custom-editor-tests port/tools/webview-check` 8/8; cargo test -p app custom_editors |
-| workbench/contrib/debug | workbench contribution | M16 | ported | [3 S] debug_view.rs: the debug views' `.expression` labels (Call Stack frame names, Variables and Watch rows) draw in the UI font where debug.contribution.css sets the 13 px editor monospace font (ui-pair `debug/call-stack-menu.json`, `FOLDER=port/fixtures/debug-node`: the reference's `global.main` is monospace) <br> [3 M] variable_menu.rs: Set Value (Variables and Watch), View Binary Data and Break on Value Read/Change/Access are not in the variable menus: no `setVariable`/`setExpression` edit, no `memoryReference` kept on a variable, no `dataBreakpointInfo` request (ui-pair `debug/variables-menu.json` shows Set Value in the reference's Watch menu) <br> [3 S] variable_menu.rs: Copy Value, Copy Expression, Edit Expression and Remove Expression from their keys (Cmd+C, Cmd+Alt+C, Enter, Cmd+Backspace in the views) do nothing: the views keep no tree selection to act on <br> [3 S] variable_menu.rs: a Variables row's menu passes `container` as `{ variablesReference }` only, where variablesView.ts `getVariablesContext` passes the scope's or parent variable's protocol object <br> [3 S] debug_view.rs: stopped at port/fixtures/debug-node/app.js line 5 the reference shows `Local: main` collapsed (ui-pair `debug/variables-menu.json`; variablesView.ts auto-expands the first scope only when `tree.hasNode` wins its race) where the port expands it; which one to match is not decided <br> [3 L] debug visualizers: debugVisualizers.ts, `VisualizedExpression` rows in the Variables view and the hover not ported <br> [3 S] lazy variables: the `$(eye)` button's look and hover not compared against the reference: with the reference's js-debug neither an object literal getter nor a class getter (port/fixtures/debug-node/lazy.js, ui-pair `debug/lazy-variable.json`) comes as a lazy `(...)` row, the hover shows `size = ƒ size()`, so the fixture still needs a value js-debug sends with `presentationHint.lazy` <br> [3 S] debug_editor: stopping at line 9 of port/fixtures/debug-node/lazy.js opens the file scrolled to line 7 at the top where the reference keeps line 1 at the top with the whole file in view (ui-pair `debug/lazy-variable.json`) <br> [3 S] debugQuickAccess.ts: Cmd+P `debug Launch lazy.js` shows the default quick access help in the port where the reference lists and starts the launch configurations <br> [3 S] debug_hover.rs: `tree_height` takes the editor's `offsetTop` as 0 where debugHover.ts `layoutTree` adds it to the tree's top and the limit; the editor's offsetParent is its group's absolutely positioned `.split-view-view` (splitview.css), so it is the group title's and breadcrumbs' height, which the hover does not know, so a complex hover above line 3 of port/fixtures/debug-node/app.js shows one row where the reference shows six (ui-pair `debug/hover-find.json`), and with the find widget open the rows draw past the tree's box <br> [3 S] debug_view.rs: in a 300 px side bar the reference's container title reads "Run And D..." and its launch picker shrinks to "L..." (debugActionViewItems.ts `StartDebugActionViewItem`), where the port keeps "Launch server.js" whole and cuts the title to "R..." (ui-pair `menus/view-container-title.json`, `FOLDER=port/fixtures/debug-node`) <br> [3 S] view_visibility.rs: the Run and Debug container's `...` menu opens 20 px right of and 20 px above the reference's (ui-pair `menus/view-container-title.json`) <br> [3 M] debug_toolbar.rs: debugToolBar.ts's Focus Session select box (`FocusSessionActionViewItem`, `multiSessionDebug`), the Stop button's `MenuId.DebugToolBarStop` dropdown, Alt over Stop or Disconnect showing its alt command, the docked toolbar in the Run and Debug title (`debug.toolBarLocation` docked) and the Command Center's Debug submenu (`commandCenter`) are not drawn <br> [3 S] debug_service.rs: `guess_debugger`'s Select Debugger picker has no Suggested and other separators, no "More {0} options..." of the dynamic providers and no "Install extension..." item, and with no candidate shows an error where debugAdapterManager.ts offers to find a language extension | ui-pair port/fixtures/debug-node: gutter breakpoint, F5 stops at it, Variables (Local: main), Call Stack with folded deemphasized frames, Breakpoints, Debug Console REPL, toolbar, status bar entry; cargo test -p app debug; Breakpoints header `$(warning)` hint for the debugger's `strings.unverifiedBreakpoints` after breakpointsView.ts's 4s `hintDelayer`, restarted by every breakpoint change (cargo test -p app debug_view; ui-pair port/fixtures/ui-pair/debug/unverified-breakpoints.json with js-debug's unbound math.test.js breakpoint); preLaunchTask, postDebugTask, compound preLaunchTask and the restart tasks through debugTaskRunner.ts's runner with `debug.onTaskErrors`, the remembered task error choice and the slow task notification (cargo test -p app debug_task_runner); Run to Cursor's temporary breakpoint with debugService.ts `runTo`'s 2s verification wait, thread choice from the sessions that verified it, and removal at the next stop or session end (cargo test -p app debug_commands); Debug Console output styled by its SGR sequences with the theme's ANSI colors at contrast 4 (cargo test -p app debug_console debug::ansi); Debug Console filter box (replFilter.ts terms, "Showing N of M" badge, Cmd+F `repl.action.filter`, value and history in workspace storage) and session picker (consoles of the sessions with `hasSeparateRepl`, `mergeWithParent` children in the parent's, selection focuses the session or its stopped child), input history in workspace storage (`debug.repl.history`) (cargo test -p app debug_console); ended sessions stay inactive in the console picker with their output until Clear Console or a start of the same configuration (debugModel.ts `addSession`, repl.ts `sessionsToIgnore`; cargo test -p app an_ended_session_stays_in_the_picker_until_cleared_or_started_again); debugUtils.ts `saveAllBeforeDebugStart` before a start (not for a child session or with `suppressSaveBeforeStart`) and a restart, by `debug.saveBeforeStart` (cargo test -p app a_start_or_restart_saves_the_dirty_editors); triggered breakpoints: debugSession.ts `enableDependentBreakpoints` by `hitBreakpointIds` or the top frame's position sets `sessionsDidTrigger` and sends the files again, continue and the steps wait for it up to 1.5 s (`waitForTriggeredBreakpoints`), a restart clears it (cargo test -p app a_hit_breakpoint_enables_its_dependents); `debug.inlineValues` after the focused frame's lines: the `InlineValuesProvider`s' values (`$provideInlineValues`) or the most specific scopes' variables named on each line, their `formatHoverContent` hover, the 100ms removal on continue (cargo test -p app debug_inline_values); debugHover.ts in place of the editor hover while a frame is focused in the file: the `$provideEvaluatableExpression` range or the dotted path under the mouse, `hover` evaluation or the scopes' variable, Cmd+K Cmd+I focused, Alt for the editor hover, the tree's list keys, Alt+click and Alt+Space toggling the loaded subtree (abstractTree.ts `onSpace`: cargo test -p app alt_click_toggles_the_loaded_subtree), a row click's tree focus, selection and twistie toggle (abstractTree.ts `onViewPointer`: cargo test -p app a_click_on_a_hover_row_focuses_the_tree) and `layoutTree` height, the glyph margin's lockout release, the caret edge nearer the mouse, lazy rows' `$(eye)` button (baseDebugView.ts `lazyButton`, `debug.autoExpandLazyVariables`; cargo test -p app a_lazy_row_takes_its_value_from_the_eye_button), the tree's find widget (abstractTree.ts `FindController`: cargo test -p app the_find_widget_filters_the_hover_tree; ui-pair port/fixtures/ui-pair/debug/hover-find.json) (cargo test -p app debug_hover; ui-pair port/fixtures/debug-node `greeting` and `numbers` hovers); disassemblyView.ts: the `disassemble` requests around the focused frame's instruction pointer, the glyph click's instruction breakpoint (`setInstructionBreakpoints`), the Breakpoints view's instruction rows, `instruction` stepping granularity while the view is active, the table's focus on reload, the list keys' focus, selection and clear, Page Up/Down over the rows' own heights, the hover column border (cargo test -p app disassembly list_tree a_step_in_the_disassembly_view debug::tests::instruction_breakpoints debug::tests::remove_instruction_breakpoints); Call Stack: js-debug's compact child session merged into its parent's row with modernUI's capitalized state label, the folded frames' common source `origin` (callStackView.ts `CallStackCompressionDelegate`, `ShowMoreRenderer`: cargo test -p app debug_view), the frame's `line:column` count badge and the trees' list focus a right click moves to them (cargo test -p app a_right_clicked_call_stack_row_takes_the_list_focus); the floating toolbar from `MenuId.DebugToolBar` with the extensions' `debug/toolBar` items, and `debug/createConfiguration` items in Select Debugger (cargo test -p app the_debug_toolbar_and_create_configuration_menus_take_contributed_items; ui-pair port/fixtures/ui-pair/debug/call-stack-menu.json); Variables, Watch and hover row context menus (debug.contribution.ts `DebugVariablesContext`, `DebugWatchContext`, `DebugHoverContext`, watchExpressionsView.ts Copy Expression and Copy All: cargo test -p app variable_menu; ui-pair port/fixtures/ui-pair/debug/variables-menu.json); shortcuts in port/notes.md |
+| workbench/contrib/debug | workbench contribution | M16 | ported | [3 S] debug_view.rs: the debug views' `.expression` labels (Call Stack frame names, Variables and Watch rows) draw in the UI font where debug.contribution.css sets the 13 px editor monospace font (ui-pair `debug/call-stack-menu.json`, `FOLDER=port/fixtures/debug-node`: the reference's `global.main` is monospace) <br> [3 M] variable_menu.rs: Set Value (Variables and Watch), View Binary Data and Break on Value Read/Change/Access are not in the variable menus: no `setVariable`/`setExpression` edit, no `memoryReference` kept on a variable, no `dataBreakpointInfo` request (ui-pair `debug/variables-menu.json` shows Set Value in the reference's Watch menu) <br> [3 S] variable_menu.rs: Copy Value, Copy Expression, Edit Expression and Remove Expression from their keys (Cmd+C, Cmd+Alt+C, Enter, Cmd+Backspace in the views) do nothing: the views keep no tree selection to act on <br> [3 S] variable_menu.rs: a Variables row's menu passes `container` as `{ variablesReference }` only, where variablesView.ts `getVariablesContext` passes the scope's or parent variable's protocol object <br> [3 L] debug visualizers: debugVisualizers.ts, `VisualizedExpression` rows in the Variables view and the hover not ported <br> [3 S] lazy variables: the `$(eye)` button's look and hover not compared against the reference: with the reference's js-debug neither an object literal getter nor a class getter (port/fixtures/debug-node/lazy.js, ui-pair `debug/lazy-variable.json`) comes as a lazy `(...)` row, the hover shows `size = ƒ size()`, so the fixture still needs a value js-debug sends with `presentationHint.lazy` <br> [3 S] debug_hover.rs: `tree_height` takes the editor's `offsetTop` as 0 where debugHover.ts `layoutTree` adds it to the tree's top and the limit; the editor's offsetParent is its group's absolutely positioned `.split-view-view` (splitview.css), so it is the group title's and breadcrumbs' height, which the hover does not know, so a complex hover above line 3 of port/fixtures/debug-node/app.js shows one row where the reference shows six (ui-pair `debug/hover-find.json`), and with the find widget open the rows draw past the tree's box <br> [3 S] debug_view.rs: in a 300 px side bar the reference's container title reads "Run And D..." and its launch picker shrinks to "L..." (debugActionViewItems.ts `StartDebugActionViewItem`), where the port keeps "Launch server.js" whole and cuts the title to "R..." (ui-pair `menus/view-container-title.json`, `FOLDER=port/fixtures/debug-node`) <br> [3 S] view_visibility.rs: the Run and Debug container's `...` menu opens 20 px right of and 20 px above the reference's (ui-pair `menus/view-container-title.json`) <br> [3 M] debug_toolbar.rs: debugToolBar.ts's Focus Session select box (`FocusSessionActionViewItem`, `multiSessionDebug`), the Stop button's `MenuId.DebugToolBarStop` dropdown, Alt over Stop or Disconnect showing its alt command, the docked toolbar in the Run and Debug title (`debug.toolBarLocation` docked) and the Command Center's Debug submenu (`commandCenter`) are not drawn <br> [3 S] debug_service.rs: `guess_debugger`'s Select Debugger picker has no Suggested and other separators, no "More {0} options..." of the dynamic providers and no "Install extension..." item, and with no candidate shows an error where debugAdapterManager.ts offers to find a language extension <br> [3 S] debugQuickAccess.ts: the picker has no dynamic configuration providers' `{label}...` picks with the `contributed` description, where the reference lists `Node.js...` (ui-pair `debug/quick-access.json`, `FOLDER=port/fixtures/debug-node`) <br> [3 S] debug_service.rs: a stop opens the Run and Debug view for any reason, where debugSession.ts opens it only for `reason === 'breakpoint'`: at the `debugger;` of port/fixtures/debug-node/lazy.js the reference stays on the Explorer (ui-pair `debug/lazy-variable.json`) <br> [3 S] debug_view.rs: scope rows (`Local: main`, `Global`) draw in the regular weight where debugViewlet.css `.debug-pane .scope` sets bold (ui-pair `debug/variables-menu.json`) <br> [3 M] debug_editor: the stopped line has no `debug-top-stack-frame-column` inline arrow before the frame's column (callStackEditorContribution.ts `makeStackFrameColumnDecoration`) and no inline breakpoint candidate dots (breakpointEditorContribution.ts, `breakpointLocations` request), and the glyph of a breakpoint the frame stops on draws a red filled shape where the reference draws the yellow outlined stack frame with a small red dot (ui-pair `debug/variables-menu.json`, line 5 of app.js) <br> [3 S] debug_toolbar.rs: the floating toolbar draws at the window's top over the title bar where the reference's sits below it over the editor tabs (ui-pair `debug/variables-menu.json`) | ui-pair port/fixtures/debug-node: gutter breakpoint, F5 stops at it, Variables (Local: main), Call Stack with folded deemphasized frames, Breakpoints, Debug Console REPL, toolbar, status bar entry; cargo test -p app debug; Breakpoints header `$(warning)` hint for the debugger's `strings.unverifiedBreakpoints` after breakpointsView.ts's 4s `hintDelayer`, restarted by every breakpoint change (cargo test -p app debug_view; ui-pair port/fixtures/ui-pair/debug/unverified-breakpoints.json with js-debug's unbound math.test.js breakpoint); preLaunchTask, postDebugTask, compound preLaunchTask and the restart tasks through debugTaskRunner.ts's runner with `debug.onTaskErrors`, the remembered task error choice and the slow task notification (cargo test -p app debug_task_runner); Run to Cursor's temporary breakpoint with debugService.ts `runTo`'s 2s verification wait, thread choice from the sessions that verified it, and removal at the next stop or session end (cargo test -p app debug_commands); Debug Console output styled by its SGR sequences with the theme's ANSI colors at contrast 4 (cargo test -p app debug_console debug::ansi); Debug Console filter box (replFilter.ts terms, "Showing N of M" badge, Cmd+F `repl.action.filter`, value and history in workspace storage) and session picker (consoles of the sessions with `hasSeparateRepl`, `mergeWithParent` children in the parent's, selection focuses the session or its stopped child), input history in workspace storage (`debug.repl.history`) (cargo test -p app debug_console); ended sessions stay inactive in the console picker with their output until Clear Console or a start of the same configuration (debugModel.ts `addSession`, repl.ts `sessionsToIgnore`; cargo test -p app an_ended_session_stays_in_the_picker_until_cleared_or_started_again); debugUtils.ts `saveAllBeforeDebugStart` before a start (not for a child session or with `suppressSaveBeforeStart`) and a restart, by `debug.saveBeforeStart` (cargo test -p app a_start_or_restart_saves_the_dirty_editors); triggered breakpoints: debugSession.ts `enableDependentBreakpoints` by `hitBreakpointIds` or the top frame's position sets `sessionsDidTrigger` and sends the files again, continue and the steps wait for it up to 1.5 s (`waitForTriggeredBreakpoints`), a restart clears it (cargo test -p app a_hit_breakpoint_enables_its_dependents); `debug.inlineValues` after the focused frame's lines: the `InlineValuesProvider`s' values (`$provideInlineValues`) or the most specific scopes' variables named on each line, their `formatHoverContent` hover, the 100ms removal on continue (cargo test -p app debug_inline_values); debugHover.ts in place of the editor hover while a frame is focused in the file: the `$provideEvaluatableExpression` range or the dotted path under the mouse, `hover` evaluation or the scopes' variable, Cmd+K Cmd+I focused, Alt for the editor hover, the tree's list keys, Alt+click and Alt+Space toggling the loaded subtree (abstractTree.ts `onSpace`: cargo test -p app alt_click_toggles_the_loaded_subtree), a row click's tree focus, selection and twistie toggle (abstractTree.ts `onViewPointer`: cargo test -p app a_click_on_a_hover_row_focuses_the_tree) and `layoutTree` height, the glyph margin's lockout release, the caret edge nearer the mouse, lazy rows' `$(eye)` button (baseDebugView.ts `lazyButton`, `debug.autoExpandLazyVariables`; cargo test -p app a_lazy_row_takes_its_value_from_the_eye_button), the tree's find widget (abstractTree.ts `FindController`: cargo test -p app the_find_widget_filters_the_hover_tree; ui-pair port/fixtures/ui-pair/debug/hover-find.json) (cargo test -p app debug_hover; ui-pair port/fixtures/debug-node `greeting` and `numbers` hovers); disassemblyView.ts: the `disassemble` requests around the focused frame's instruction pointer, the glyph click's instruction breakpoint (`setInstructionBreakpoints`), the Breakpoints view's instruction rows, `instruction` stepping granularity while the view is active, the table's focus on reload, the list keys' focus, selection and clear, Page Up/Down over the rows' own heights, the hover column border (cargo test -p app disassembly list_tree a_step_in_the_disassembly_view debug::tests::instruction_breakpoints debug::tests::remove_instruction_breakpoints); Call Stack: js-debug's compact child session merged into its parent's row with modernUI's capitalized state label, the folded frames' common source `origin` (callStackView.ts `CallStackCompressionDelegate`, `ShowMoreRenderer`: cargo test -p app debug_view), the frame's `line:column` count badge and the trees' list focus a right click moves to them (cargo test -p app a_right_clicked_call_stack_row_takes_the_list_focus); the floating toolbar from `MenuId.DebugToolBar` with the extensions' `debug/toolBar` items, and `debug/createConfiguration` items in Select Debugger (cargo test -p app the_debug_toolbar_and_create_configuration_menus_take_contributed_items; ui-pair port/fixtures/ui-pair/debug/call-stack-menu.json); Variables, Watch and hover row context menus (debug.contribution.ts `DebugVariablesContext`, `DebugWatchContext`, `DebugHoverContext`, watchExpressionsView.ts Copy Expression and Copy All: cargo test -p app variable_menu; ui-pair port/fixtures/ui-pair/debug/variables-menu.json); a stop reveals its line centered only when outside the view, after the editor's first layout (debugSource.ts `openInEditor` `CenterIfOutsideViewport`: cargo test -p app a_stop_on_a_line_in_view_keeps_the_scroll; ui-pair port/fixtures/ui-pair/debug/lazy-variable.json); debugQuickAccess.ts `debug ` picks: the launch configurations by folder with Most Recent, their gear to launch.json, Add Configuration..., and Debug: Select and Start Debugging opening it (cargo test -p app the_debug_picker_lists_and_starts_the_launch_configurations; ui-pair port/fixtures/ui-pair/debug/quick-access.json); the first cheap scope expands on a focus change only once the Variables view has shown, as variablesView.ts `renderBody` sets its first input unexpanded (cargo test -p app the_first_scope_expands_only_once_the_variables_view_exists; ui-pair port/fixtures/ui-pair/debug/variables-menu.json `Local: main` collapsed in both); shortcuts in port/notes.md |
| workbench/contrib/dropOrPasteInto | workbench contribution | M13 | verified | | commands.ts `configurePreferredPasteAction`/`configurePreferredDropAction`: the widgets' menus and the Paste As pick open user settings JSON at `editor.pasteAs.preferences` or `editor.dropIntoEditor.preferences` (workbench/paste_edits.rs); the `editor.pasteAs.*` and `editor.dropIntoEditor.*` settings come from core-settings.json; ui-pair paste-menu (port/results/language-features.md) |
| workbench/contrib/editSessions | workbench contribution | | removed | | no sign-in/AI by decision (port/notes.md); not ported |
| workbench/contrib/editTelemetry | workbench contribution | | removed | | no AI or Microsoft services by decision (port/notes.md); API stays inert |