Visual Studio Code, rebuilt in Rust
Rust
Merge branch 'port-integrate' into port-audit-platform
rokartur6d62f905e391
diff --cc native/crates/app/src/editor/injected_text.rsindex 09de9b4cc5a,09761fe9b63..06025f2ded4--- a/native/crates/app/src/editor/injected_text.rs+++ b/native/crates/app/src/editor/injected_text.rs@@@ -18,10 -17,77 +17,80 @@@ pub enum InjectionOwnerDecorationContent,/// The room of the inline progress widget, which draws itself.InlineProgress,+ /// A debug inline value after its line (debugEditorContribution.ts `createInlineValueDecoration`).+ DebugInlineValue,}+ impl InjectionOwner {+ /// The `InjectedTextCursorStops` of the owner's injections: an inlay hint's last part `Right`, ghost text `Left`,+ /// a color box and the progress room the default `Both`. Decoration content is CSS content upstream, outside+ /// the view positions, so the cursor stays before it.+ fn cursor_stops(self) -> CursorStops {+ match self {+ InjectionOwner::InlayHint => CursorStops::Right,- InjectionOwner::GhostText | InjectionOwner::DecorationContent => CursorStops::Left,++ // A debug inline value's `InjectedTextCursorStops.None` sits at the line's end, where Left is the one stop.++ InjectionOwner::GhostText | InjectionOwner::DecorationContent | InjectionOwner::DebugInlineValue => CursorStops::Left,+ InjectionOwner::Color | InjectionOwner::InlineProgress => CursorStops::Both,+ }+ }+ }++ #[derive(Clone, Copy, Debug, PartialEq)]+ pub enum CursorStops {+ Left,+ Right,+ Both,+ }++ impl CursorStops {+ fn left(self) -> bool {+ self != CursorStops::Right+ }++ fn right(self) -> bool {+ self != CursorStops::Left+ }+ }++ /// `normalizeOffsetInInputWithInjectionsAroundInjections` with `PositionAffinity.None` over the injections at one+ /// column: a position `past` of them (clamped to all) moves to where a cursor may rest, also as a count.+ pub fn cursor_stop(stops: &[CursorStops], past: usize) -> usize {+ let past = past.min(stops.len());+ if stops.is_empty() {+ return 0;+ }+ let index = past.saturating_sub(1);+ if past > 0 && stops[index].right() {+ return past;+ }+ if stops[index].left() {+ return index;+ }+ let mut result = index;+ for previous in (0..index).rev() {+ if stops[previous].right() {+ break;+ }+ result -= 1;+ if stops[previous].left() {+ break;+ }+ }+ result+ }++ /// How monospaceLineBreaksComputer.ts measures an injected text when wrapping; the drawn width does not count.+ #[derive(Clone, Copy, Debug, PartialEq)]+ pub enum WrapWidth {+ /// Each injected char its own column width, whatever font draws it.+ Chars,+ /// `widthInEm`: one piece `columns` wide that never breaks.+ Fixed,+ /// An inlay hint: its label chars between its `paddingLeft` and `paddingRight` whitespace (width-only+ /// injections) of these columns; the `editor.inlayHints.padding` box and font size do not count.+ Hint { left: f32, right: f32 },+ }+/// One injected text before the char at `position` (after the line's last char at its length).#[derive(Clone, Debug, PartialEq)]pub struct InjectedText {diff --cc native/crates/app/src/workbench/debug_inline_values.rsindex cc6bd1c6719,00000000000..d5427be301bmode 100644,000000..100644--- a/native/crates/app/src/workbench/debug_inline_values.rs+++ b/native/crates/app/src/workbench/debug_inline_values.rs@@@ -1,479 -1,0 +1,479 @@@+//! debugEditorContribution.ts inline values: with `debug.inlineValues` on, the focused stack frame's values after the+//! lines of its file in the active editor, from the `InlineValuesProvider`s, else from the variables of the frame's+//! most specific scopes found as words of the lines (`createInlineValueDecoration`, its hover `formatHoverContent`).+// shortcut: only the active editor shows the values, where upstream decorates every editor on the frame's file; needs the state per editor.++use std::collections::{HashMap, HashSet};+use std::time::Duration;++use gpui::{AnyElement, AsyncApp, Context, Task, WeakEntity, div, prelude::*, px};+use serde_json::{Value, json};++use super::Workbench;+use super::content_hover::{Anchor, Part, PartContent, Participant};+use crate::debug::session::{StackFrame, Variable};+use crate::editor::in_place_replace::DEFAULT_WORD_REGEXP;- use crate::editor::injected_text::{InjectedText, InjectionOwner};++use crate::editor::injected_text::{InjectedText, InjectionOwner, WrapWidth};+use crate::editor::{OpenEditor, Position, TextDocument, char_column};+use crate::language_feature_debounce::FeatureDebounce;+use crate::language_features::Candidate;++#[cfg(test)]+mod tests;++const REGISTER: &str = "$registerInlineValuesProvider";+const MAX_NUM_INLINE_VALUES: usize = 100;+const MAX_TOKENIZATION_LINE_LEN: usize = 500;+/// `removeInlineValuesScheduler`.+const REMOVE_DELAY: Duration = Duration::from_millis(100);+const SPACER: char = '\u{a0}';++/// A 1-based (line, column) of `IRange`.+type At = (u64, u64);++#[derive(Default)]+pub(super) struct DebugInlineValues {+ /// The text of each shown value by its injection id, uncut, for its hover.+ texts: Vec<String>,+ /// `updateInlineValuesScheduler`.+ scheduled: Option<Task<()>>,+ /// The update in flight; dropping it cancels it (`displayedStore`).+ running: Option<Task<()>>,+ removing: Option<Task<()>>,+ /// `debounceInfo`: `{ min: 200 }`, so `max` is 200 ** 2.+ debounce: FeatureDebounce<200, 40000>,+}++impl Workbench {+ /// `updateInlineValuesScheduler.schedule()`: an edit, or a scroll with providers to ask about the new lines.+ pub(super) fn schedule_debug_inline_values(&mut self, cx: &mut Context<Self>) {+ let delay = match self.editors.active() {+ Some(editor) => {+ let key = self.inline_values_debounce_key(editor);+ self.debug_inline_values.debounce.get(&key)+ }+ None => Duration::from_millis(200),+ };+ self.debug_inline_values.scheduled = Some(cx.spawn(async move |workbench, cx| {+ cx.background_executor().timer(delay).await;+ let _ = workbench.update(cx, |workbench, cx| workbench.update_debug_inline_values(cx));+ }));+ }++ /// `onDidScrollChange`: only the providers' values depend on the visible lines.+ pub(super) fn debug_inline_values_scrolled(&mut self, cx: &mut Context<Self>) {+ if self.editors.active().is_some_and(|editor| !self.inline_values_handles(editor).is_empty()) {+ self.schedule_debug_inline_values(cx);+ }+ }++ /// `updateInlineValueDecorations` for the focused frame: off, or with the frame in another file, the values+ /// go 100ms later.+ pub(super) fn update_debug_inline_values(&mut self, cx: &mut Context<Self>) {+ self.debug_inline_values.scheduled = None;+ let Some((model_id, frame, handles)) = self.inline_values_target() else {+ if self.debug_inline_values.removing.is_none() {+ self.debug_inline_values.removing = Some(cx.spawn(async move |workbench, cx| {+ cx.background_executor().timer(REMOVE_DELAY).await;+ let _ = workbench.update(cx, |workbench, cx| {+ workbench.debug_inline_values.removing = None;+ workbench.debug_inline_values.running = None;+ workbench.clear_debug_inline_values();+ cx.notify();+ });+ }));+ }+ return;+ };+ self.debug_inline_values.removing = None;+ let Some(session_id) = self.debug.focus.session.clone() else { return };+ let editor = self.editors.active().expect("found by the target");+ let lines = &editor.document().lines;+ let view_ranges: Vec<(At, At)> = super::semantic_tokens::visible_ranges_plus_viewport_above_below(editor, self.editors.viewport)+ .into_iter()+ .map(|(start, end)| ((start as u64 + 1, 1), (end as u64 + 1, lines[end].encode_utf16().count() as u64 + 1)))+ .collect();+ let uri = editor.document().uri();+ let debounce_key = self.inline_values_debounce_key(editor);+ self.debug_inline_values.running = Some(cx.spawn(async move |workbench, cx| {+ let values = match handles.is_empty() {+ true => scope_values(&workbench, cx, &session_id, &frame, model_id, &view_ranges).await,+ false => {+ let started = cx.background_executor().now();+ let values = provider_values(&workbench, cx, &session_id, &frame, model_id, uri, &handles, &view_ranges).await;+ let elapsed = cx.background_executor().now() - started;+ let _ = workbench.update(cx, |workbench, _| workbench.debug_inline_values.debounce.update(&debounce_key, elapsed));+ values+ }+ };+ let _ = workbench.update(cx, |workbench, cx| workbench.show_debug_inline_values(model_id, values, cx));+ }));+ }++ /// The active editor's model, the focused frame and the editor's inline values providers when+ /// `debug.inlineValues` is `on` (or `auto` with a provider) and the frame is in the editor's file.+ fn inline_values_target(&self) -> Option<(u32, StackFrame, Vec<u64>)> {+ let editor = self.editors.active()?;+ let frame = self.debug.focused_frame()?;+ let handles = self.inline_values_handles(editor);+ let setting = self.setting("debug.inlineValues");+ let on = setting == true || setting == "on" || (setting == "auto" && !handles.is_empty());+ let document = editor.document();+ let same_file = document.scheme == "file" && frame.path() == Some(&*document.path.to_string_lossy());+ (on && same_file).then(|| (editor.model_id, frame.clone(), handles))+ }++ /// `inlineValuesProvider.ordered(model)`, best first.+ fn inline_values_handles(&self, editor: &OpenEditor) -> Vec<u64> {+ let uri = editor.document().uri();+ let language = editor.document().language_id.clone();+ let candidate = Candidate { uri: &uri, language: &language };+ self.language_features.ordered(REGISTER, &candidate).iter().map(|registration| registration.handle).collect()+ }++ fn inline_values_debounce_key(&self, editor: &OpenEditor) -> String {+ format!("{}{:?}", editor.document().uri(), self.inline_values_handles(editor))+ }++ /// `oldDecorations.set`: with word wrap the values can wrap lines, so the cursor keeps its top when visible.+ fn show_debug_inline_values(&mut self, model_id: u32, values: Vec<(usize, String)>, cx: &mut Context<Self>) {+ self.debug_inline_values.running = None;+ self.clear_debug_inline_values();+ let viewport = self.editors.viewport;+ // shortcut: the text area's width stands for `layoutInfo.width`, a left minimap's width short; needs the editor's width kept.+ let max_columns = ((self.text_area_bounds.get().size.width - 50.) / viewport.char_width).floor().max(0.) as usize;+ let Some(editor) = self.editors.editors.iter_mut().find(|editor| editor.model_id == model_id) else { return };+ let cursor_line = editor.head_view_line(0);+ let kept_top = (editor.wraps() && editor.visible_lines(viewport).contains(&cursor_line)).then(|| editor.line_top(cursor_line, viewport));+ let mut injections = Vec::new();+ let mut texts = Vec::new();+ for (line, text) in values {+ let content = inline_value_content(&text, max_columns);+ let position = Position::new(line, editor.document().lines[line].chars().count());- injections.push(InjectedText { position, columns: content.chars().count() as f32, content, owner: InjectionOwner::DebugInlineValue, id: texts.len(), at_range_start: false });++ injections.push(InjectedText { position, columns: content.chars().count() as f32, content, wrap: WrapWidth::Chars, owner: InjectionOwner::DebugInlineValue, id: texts.len(), at_range_start: false });+ texts.push(text);+ }+ editor.set_injected_text(InjectionOwner::DebugInlineValue, injections);+ if let Some(top) = kept_top {+ let cursor_line = editor.head_view_line(0);+ editor.scroll.top = (editor.scroll.top - (top - editor.line_top(cursor_line, viewport))).max(0.);+ }+ self.debug_inline_values.texts = texts;+ cx.notify();+ }++ fn clear_debug_inline_values(&mut self) {+ for editor in self.editors.editors.iter_mut().chain(&mut self.editors.models) {+ if editor.injected_text.iter().any(|injection| injection.owner == InjectionOwner::DebugInlineValue) {+ editor.set_injected_text(InjectionOwner::DebugInlineValue, Vec::new());+ }+ }+ self.debug_inline_values.texts.clear();+ }++ /// `.debug-inline-value` after its no-break space spacer.+ pub(super) fn debug_inline_value_element(&self, content: &str, left: f32, line_height: f32) -> AnyElement {+ let value = content.strip_prefix(SPACER).expect("made with the spacer").to_owned();+ let value = div().bg(self.color("editor.inlineValuesBackground")).text_color(self.color("editor.inlineValuesForeground")).child(value);+ div().absolute().top_0().left(px(left)).h(px(line_height)).flex().items_center().whitespace_nowrap().child(SPACER.to_string()).child(value).into_any_element()+ }++ /// markdownHoverParticipant.ts `computeSync`: the `hoverMessage` of a value whose line end the anchor touches.+ pub(super) fn debug_inline_value_hover_parts(&self, editor: &OpenEditor, anchor: Anchor) -> Vec<Part> {+ let mut parts = Vec::new();+ for injection in editor.injected_text_on(anchor.line).iter().filter(|injection| injection.owner == InjectionOwner::DebugInlineValue) {+ let column = injection.position.column;+ if column > anchor.start + 1 || anchor.end > column + 1 {+ continue;+ }+ let content = PartContent::Markdown(vec![json!({ "value": format_hover_content(&self.debug_inline_values.texts[injection.id]) })]);+ parts.push(Part { participant: Participant::Markdown, ordinal: parts.len(), start: injection.position, end: injection.position, content, source: None });+ }+ parts+ }+}++/// The providers' values, each value's line its segments by column joined with `, `.+#[allow(clippy::too_many_arguments)]+async fn provider_values(workbench: &WeakEntity<Workbench>, cx: &mut AsyncApp, session_id: &str, frame: &StackFrame, model_id: u32, uri: Value, handles: &[u64], view_ranges: &[(At, At)]) -> Vec<(usize, String)> {+ let range = |(start, end): (At, At)| json!({ "startLineNumber": start.0, "startColumn": start.1, "endLineNumber": end.0, "endColumn": end.1 });+ let stopped = range(((frame.line as u64, frame.column as u64 + 1), (frame.end_line as u64, frame.end_column as u64 + 1)));+ let context = json!({ "frameId": frame.id, "stoppedLocation": stopped });+ let Ok(calls) = workbench.update(cx, |workbench, _| {+ let mut calls = Vec::new();+ for &handle in handles.iter().rev() {+ for &view_range in view_ranges {+ calls.push(workbench.host.call_cancellable("ExtHostLanguageFeatures", "$provideInlineValues", vec![json!(handle), uri.clone(), range(view_range), context.clone()]));+ }+ }+ calls+ }) else {+ return Vec::new();+ };+ let mut segments: Vec<(usize, Vec<(u64, String)>)> = Vec::new();+ let mut scope_variables: Option<Vec<Variable>> = None;+ for call in calls {+ let Ok(Ok(values)) = call.await else { continue };+ for value in values.as_array().into_iter().flatten() {+ let start: At = (value["range"]["startLineNumber"].as_u64().unwrap_or(1), value["range"]["startColumn"].as_u64().unwrap_or(1));+ let end_column = value["range"]["endColumn"].as_u64().unwrap_or(1);+ let source_text = |cx: &mut AsyncApp| workbench.update(cx, |workbench, _| range_text(workbench, model_id, start, end_column)).unwrap_or_default();+ let text = match value["type"].as_str() {+ Some("text") => value["text"].as_str().map(str::to_owned),+ Some("variable") => {+ let name = value["variableName"].as_str().map(str::to_owned).unwrap_or_else(|| source_text(cx));+ if scope_variables.is_none() {+ scope_variables = Some(most_specific_scope_variables(workbench, cx, session_id, frame).await.into_iter().flat_map(|(_, variables)| variables).collect());+ }+ let case_sensitive = value["caseSensitiveLookup"] == true;+ let found = scope_variables.iter().flatten().find(|variable| if case_sensitive { variable.name == name } else { variable.name.to_lowercase() == name.to_lowercase() });+ found.filter(|variable| !variable.value.is_empty()).map(|variable| format!("{name} = {}", variable.value))+ }+ Some("expression") => {+ let expression = value["expression"].as_str().map(str::to_owned).unwrap_or_else(|| source_text(cx));+ match expression.is_empty() {+ true => None,+ false => evaluate(workbench, cx, session_id, frame.id, &expression).await.map(|result| format!("{expression} = {result}")),+ }+ }+ _ => None,+ };+ let Some(text) = text.filter(|text| !text.is_empty()) else { continue };+ let line = start.0.max(1) as usize - 1;+ let index = match segments.iter().position(|(shown, _)| *shown == line) {+ Some(index) => index,+ None => {+ segments.push((line, Vec::new()));+ segments.len() - 1+ }+ };+ if !segments[index].1.iter().any(|(_, shown)| *shown == text) {+ segments[index].1.push((start.1, text));+ }+ }+ }+ let mut values = Vec::new();+ for (line, mut line_segments) in segments {+ line_segments.sort_by_key(|(column, _)| *column);+ values.push((line, line_segments.into_iter().map(|(_, text)| text).collect::<Vec<_>>().join(", ")));+ }+ values+}++/// The old "one-size-fits-all" strategy: the scopes' values on the lines that name them.+async fn scope_values(workbench: &WeakEntity<Workbench>, cx: &mut AsyncApp, session_id: &str, frame: &StackFrame, model_id: u32, view_ranges: &[(At, At)]) -> Vec<(usize, String)> {+ let scopes = most_specific_scope_variables(workbench, cx, session_id, frame).await;+ let frame_start = (frame.line as u64, frame.column as u64);+ workbench+ .update(cx, |workbench, _| {+ let Some(editor) = workbench.editors.editors.iter().find(|editor| editor.model_id == model_id) else { return Vec::new() };+ words_inline_values(&editor.document(), &scopes, frame_start, view_ranges)+ })+ .unwrap_or_default()+}++/// The (start, end) of a scope's DAP range, when it has one.+type ScopeRange = Option<(At, At)>;++/// `getMostSpecificScopes(stackFrame.range)` and each scope's `getChildren`.+// shortcut: each update asks for the scopes and variables again, where upstream's frame caches them for the Variables view too; needs a shared cache.+async fn most_specific_scope_variables(workbench: &WeakEntity<Workbench>, cx: &mut AsyncApp, session_id: &str, frame: &StackFrame) -> Vec<(ScopeRange, Vec<Variable>)> {+ let Ok(reply) = workbench.update(cx, |workbench, _| workbench.dap_request(session_id, "scopes", json!({ "frameId": frame.id }))) else { return Vec::new() };+ let Ok(Ok(body)) = reply.await else { return Vec::new() };+ let scopes = most_specific_scopes(body["scopes"].as_array().map_or(&[], Vec::as_slice), frame);+ let mut result = Vec::new();+ for (range, reference) in scopes {+ let Ok(reply) = workbench.update(cx, |workbench, _| workbench.dap_request(session_id, "variables", json!({ "variablesReference": reference }))) else { break };+ let variables = match reply.await {+ Ok(Ok(body)) => body["variables"].as_array().into_iter().flatten().map(Variable::from_dap).collect(),+ _ => Vec::new(),+ };+ result.push((range, variables));+ }+ result+}++/// debugModel.ts `getMostSpecificScopes`: the scopes that are not expensive; with ranges, those around the frame's+/// range, narrowest first, unless none is. Each with its range and `variablesReference`.+fn most_specific_scopes(scopes: &[Value], frame: &StackFrame) -> Vec<(ScopeRange, i64)> {+ let cheap: Vec<(ScopeRange, i64)> = scopes.iter().filter(|scope| scope["expensive"] != true).map(|scope| (scope_range(scope), scope["variablesReference"].as_i64().unwrap_or(0))).collect();+ if cheap.iter().all(|(range, _)| range.is_none()) {+ return cheap;+ }+ let frame_range = ((frame.line as u64, frame.column as u64), (frame.end_line as u64, frame.end_column as u64));+ let mut around: Vec<(ScopeRange, i64)> = cheap.iter().copied().filter(|(range, _)| range.is_some_and(|(start, end)| start <= frame_range.0 && frame_range.1 <= end)).collect();+ around.sort_by_key(|(range, _)| range.map(|(start, end)| end.0 - start.0));+ if around.is_empty() { cheap } else { around }+}++/// debugModel.ts `new Scope(...)`: a range only with all four of `line`, `column`, `endLine` and `endColumn`.+fn scope_range(scope: &Value) -> ScopeRange {+ let number = |key: &str| scope[key].as_u64().filter(|value| *value != 0);+ Some(((number("line")?, number("column")?), (number("endLine")?, number("endColumn")?)))+}++/// The scopes from the narrowest out: in its part of the view ranges up to the frame's position, each line that has+/// a variable's name as a word shows it, a name keeping the value of its narrowest scope (#129770, #217326).+fn words_inline_values(document: &TextDocument, scopes: &[(ScopeRange, Vec<Variable>)], frame_start: At, view_ranges: &[(At, At)]) -> Vec<(usize, String)> {+ let mut words: HashMap<String, Vec<u64>> = HashMap::new();+ let mut parsed = HashSet::new();+ let mut values_per_line: Vec<(u64, Vec<(String, String)>)> = Vec::new();+ for (range, variables) in scopes {+ let scope_start = range.map_or((0, 0), |(start, _)| start);+ let own_ranges: Vec<(At, At)> = view_ranges.iter().map(|&(start, end)| (start.max(scope_start), end.min(frame_start))).filter(|(start, end)| start <= end).collect();+ for &(start, end) in &own_ranges {+ for line in start.0..=end.0 {+ if parsed.insert(line) {+ line_words(document, line, &mut words);+ }+ }+ }+ for (line, names) in names_per_line(document, variables, &own_ranges, &words) {+ let index = match values_per_line.iter().position(|(shown, _)| *shown == line) {+ Some(index) => index,+ None => {+ values_per_line.push((line, Vec::new()));+ values_per_line.len() - 1+ }+ };+ let values = &mut values_per_line[index].1;+ for (name, value) in names {+ if !values.iter().any(|(shown, _)| *shown == name) {+ values.push((name, value));+ }+ }+ }+ }+ let joined = |values: Vec<(String, String)>| values.into_iter().map(|(name, value)| format!("{name} = {value}")).collect::<Vec<_>>().join(", ");+ values_per_line.into_iter().map(|(line, values)| (line as usize - 1, joined(values))).collect()+}++/// `createInlineValueDecorationsInsideRange`: the first 100 names' values, on each line in `ranges` that has the+/// name as a word, in the order the line has them.+fn names_per_line(document: &TextDocument, variables: &[Variable], ranges: &[(At, At)], words: &HashMap<String, Vec<u64>>) -> Vec<(u64, Vec<(String, String)>)> {+ let mut name_values: Vec<(&str, &str)> = Vec::new();+ for variable in variables {+ match name_values.iter_mut().find(|(name, _)| *name == variable.name) {+ Some(entry) => entry.1 = &variable.value,+ None => name_values.push((&variable.name, &variable.value)),+ }+ if name_values.len() >= MAX_NUM_INLINE_VALUES {+ break;+ }+ }+ let mut line_names: Vec<(u64, Vec<&str>)> = Vec::new();+ for &(name, _) in &name_values {+ for &line in words.get(name).into_iter().flatten() {+ if !ranges.iter().any(|(start, end)| line >= start.0 && line <= end.0) {+ continue;+ }+ match line_names.iter_mut().find(|(shown, _)| *shown == line) {+ Some((_, names)) if names.contains(&name) => {}+ Some((_, names)) => names.push(name),+ None => line_names.push((line, vec![name])),+ }+ }+ }+ let mut result = Vec::new();+ for (line, mut names) in line_names {+ let text = &document.lines[line as usize - 1];+ names.sort_by_key(|name| text.find(name));+ let value = |name: &str| name_values.iter().find(|(shown, _)| *shown == name).expect("named above").1.to_owned();+ result.push((line, names.into_iter().map(|name| (name.to_owned(), value(name))).collect()));+ }+ result+}++/// `getWordToLineNumbersMap`: the first word of each `Other` token of the 1-based `line`; a line over 500 chars+/// is skipped.+fn line_words(document: &TextDocument, line: u64, words: &mut HashMap<String, Vec<u64>>) {+ let index = line as usize - 1;+ let text = &document.lines[index];+ if text.encode_utf16().count() > MAX_TOKENIZATION_LINE_LEN {+ return;+ }+ let mut start = 0;+ for (end, token_type, _) in document.tokens.line_tokens(&document.lines, index) {+ let token = &text[start..end];+ if token_type == textmate::StandardTokenType::Other+ && let Some((word_start, word_end)) = DEFAULT_WORD_REGEXP.find(token)+ {+ words.entry(token[word_start..word_end].to_owned()).or_default().push(line);+ }+ start = end;+ }+}++/// The model text of a value's range on its line, by UTF-16 columns.+fn range_text(workbench: &Workbench, model_id: u32, start: At, end_column: u64) -> String {+ let Some(editor) = workbench.editors.editors.iter().find(|editor| editor.model_id == model_id) else { return String::new() };+ let document = editor.document();+ let Some(text) = document.lines.get(start.0.max(1) as usize - 1) else { return String::new() };+ let (from, to) = (char_column(text, start.1.max(1) as usize - 1), char_column(text, end_column.max(1) as usize - 1));+ text.chars().skip(from).take(to.saturating_sub(from)).collect()+}++/// `Expression.evaluate(session, frame, 'watch')`: the result when the adapter answered with a body.+async fn evaluate(workbench: &WeakEntity<Workbench>, cx: &mut AsyncApp, session_id: &str, frame_id: i64, expression: &str) -> Option<String> {+ let reply = workbench.update(cx, |workbench, _| workbench.dap_request(session_id, "evaluate", json!({ "expression": expression, "frameId": frame_id, "context": "watch" }))).ok()?;+ let body = reply.await.ok()?.ok().filter(|body| !body.is_null())?;+ Some(body["result"].as_str().unwrap_or_default().to_owned())+}++/// `createInlineValueDecoration`: the spacer, then the text cut at `max_columns` UTF-16 units with `...`, its+/// spaces, tabs and newlines as no-break spaces.+fn inline_value_content(text: &str, max_columns: usize) -> String {+ let units: Vec<u16> = text.encode_utf16().collect();+ let shown = match units.len() > max_columns {+ true => String::from_utf16_lossy(&units[..max_columns]) + "...",+ false => text.to_owned(),+ };+ format!("{SPACER}{}", shown.replace([' ', '\t', '\n'], &SPACER.to_string()))+}++/// `formatHoverContent`: a code block of the text; `name = value` pairs split at the comma before each `=` after+/// the first, one per line, a pair's later lines indented past its `=`.+pub(super) fn format_hover_content(text: &str) -> String {+ let code = match text.contains(',') && text.contains('=') {+ true => hover_pairs(text).iter().map(|pair| indent_pair(pair)).collect::<Vec<_>>().join(",\n"),+ false => text.to_owned(),+ };+ format!("\n{}\n", crate::snippets::escaped_code_block_fence(&code, ""))+}++fn hover_pairs(text: &str) -> Vec<String> {+ let mut splits = Vec::new();+ let mut equals_found = 0;+ let mut start = 0;+ for (index, c) in text.char_indices() {+ if c != '=' {+ continue;+ }+ if equals_found > 0+ && let Some(comma) = text[..=index].rfind(',').filter(|comma| *comma >= start)+ {+ splits.push(comma);+ start = comma + 1;+ }+ equals_found += 1;+ }+ let mut pairs = Vec::new();+ let mut from = 0;+ for split in splits {+ pairs.push(text[from..split].trim().to_owned());+ from = split + 1;+ }+ if from < text.len() {+ pairs.push(text[from..].trim().to_owned());+ }+ pairs+}++fn indent_pair(pair: &str) -> String {+ let Some(equals) = pair.find('=') else { return pair.to_owned() };+ let indent = " ".repeat(pair[..equals].encode_utf16().count() + 2);+ let pair = pair.replace("\r\n", "\n");+ let mut lines = pair.split('\n');+ let first = lines.next().unwrap_or_default().to_owned();+ lines.fold(first, |text, line| format!("{text}\n{indent}{line}"))+}diff --cc port/ledger.mdindex 882d76db5d0,685fc7c6223..4251ad4e238--- a/port/ledger.md+++ b/port/ledger.md@@@ -407,8 -407,8 +407,8 @@@ One row per upstream unit, generated b| workbench/services/language | workbench service | M7 | verified | | getAssociationByPath with the full glob dialect (languages::tests::file_patterns_take_the_whole_glob_dialect) plus firstLine detection (languages.rs); cargo test -p app languages::tests || workbench/services/languageDetection | workbench service | M13 | verified | | language_detection.rs (languageDetectionWebWorker.ts `detectLanguagesImpl`, `adjustLanguageConfidence`, the 10000 char sample) and workbench/language_detection.rs (`LanguageDetectionWorkerClient`: the file name guess first, then @vscode/vscode-languagedetection 1.0.23 with its model in a Bun worker from the app's node_modules, model ids mapped as `getLanguageId`; `autoDetectLanguage` of textEditorModel.ts for untitled models and extensionless plain text files, 600 ms throttle, skipped after an explicit language and with `workbench.editor.languageDetection` off): cargo test -p app language_detection (the worker test runs the real model). The history biases only feed the regexp model, which 1.147.0 does not ship (`vscode-regexp-languagedetection` is not a dependency), so neither side has it; no telemetry || workbench/services/languageStatus | workbench service | M13 | verified | | `$setLanguageStatus` / `$removeLanguageStatus`, statuses matched by selector, ordered by severity, source, id (workbench/language_status.rs): cargo test -p app language_status |- | workbench/services/layout | workbench service | M11 | verified | | layout.ts as a split-view tree (workbench/layout.rs): panel position (bottom, top, left, right) and alignment, primary side bar left or right, maximized panel with `panelMaximizationSupportedWhen`, hidden parts, persisted sizes and positions; zen mode (zen_mode.rs) with its settings and restore; centered layout (centered_layout.rs) with its sashes and stored margins; View > Appearance entries and the Panel Position and Align Panel submenus (cargo test -p app -- layout part_grid centered_layout zen_mode); layoutActions.ts Customize Layout quick pick (workbench/customize_layout.rs) with live items, Restore Defaults and Close, Toggle Activity Bar Visibility, Align Quick Input Top/Center (cargo test -p app -- customize_layout toggling_the_activity_bar; ui-pair m11/manage-menu.json, port/results/manage-menu.md; missing until then though the title bar showed its button); ui-pair layout-positions.json and layout-zen.json against the reference (port/results/layout.md). The pairs run with `zenMode.fullScreen` off. Maximize Secondary Side Bar (`workbench.action.maximizeAuxiliaryBar`, `restoreAuxiliaryBar`, `toggleMaximizedAuxiliaryBar`, the title's toggle) hides the other parts and restores them (workbench/panel.rs; cargo test -p app -- maximizing_the_secondary_side_bar_hides_the_other_parts_and_restore_brings_them_back). Zen mode enforces `zenMode.showTabs` on the main editor part until it ends (layout.ts `toggleZenMode` `enforcePartOptions`; workbench/zen_mode.rs `editor_show_tabs`; cargo test -p app -- show_tabs_picks_the_title_control_and_zen_mode_enforces_its_own); navigationActions.ts `workbench.action.focusNextPart`/`focusPreviousPart` (F6, Shift+F6) walk editor, panel, auxiliary bar, status bar, activity bar and side bar past the hidden ones with layout.ts `focusPart` (the pane container's first expanded view; workbench/part_navigation.rs; cargo test -p app f6_walks_the_visible_parts); in an editor window F6 goes between its editor and its own status bar, whose entry focus is kept per window (workbench/auxiliary_windows.rs `auxiliary_status_bar`, workbench/status_entries.rs; cargo test -p app f6_in_an_editor_window_reaches_its_own_status_bar) |+ | workbench/services/layout | workbench service | M11 | ported | [3 L] editor_status.rs:606, content_hover.rs:498: no workbench-wide Tab order (the browser's DOM order): Tab stops at the content hover's ends, and Tab on the status bar in Tab Focus Mode keeps the focus (port/notes.md Toggle Tab Key Moves Focus) | layout.ts as a split-view tree (workbench/layout.rs): panel position (bottom, top, left, right) and alignment, primary side bar left or right, maximized panel with `panelMaximizationSupportedWhen`, hidden parts, persisted sizes and positions; zen mode (zen_mode.rs) with its settings and restore; centered layout (centered_layout.rs) with its sashes and stored margins; View > Appearance entries and the Panel Position and Align Panel submenus (cargo test -p app -- layout part_grid centered_layout zen_mode); layoutActions.ts Customize Layout quick pick (workbench/customize_layout.rs) with live items, Restore Defaults and Close, Toggle Activity Bar Visibility, Align Quick Input Top/Center (cargo test -p app -- customize_layout toggling_the_activity_bar; ui-pair m11/manage-menu.json, port/results/manage-menu.md; missing until then though the title bar showed its button); ui-pair layout-positions.json and layout-zen.json against the reference (port/results/layout.md). The pairs run with `zenMode.fullScreen` off. Maximize Secondary Side Bar (`workbench.action.maximizeAuxiliaryBar`, `restoreAuxiliaryBar`, `toggleMaximizedAuxiliaryBar`, the title's toggle) hides the other parts and restores them (workbench/panel.rs; cargo test -p app -- maximizing_the_secondary_side_bar_hides_the_other_parts_and_restore_brings_them_back). Zen mode enforces `zenMode.showTabs` on the main editor part until it ends (layout.ts `toggleZenMode` `enforcePartOptions`; workbench/zen_mode.rs `editor_show_tabs`; cargo test -p app -- show_tabs_picks_the_title_control_and_zen_mode_enforces_its_own); navigationActions.ts `workbench.action.focusNextPart`/`focusPreviousPart` (F6, Shift+F6) walk editor, panel, auxiliary bar, status bar, activity bar and side bar past the hidden ones with layout.ts `focusPart` (the pane container's first expanded view; workbench/part_navigation.rs; cargo test -p app f6_walks_the_visible_parts); in an editor window F6 goes between its editor and its own status bar, whose entry focus is kept per window (workbench/auxiliary_windows.rs `auxiliary_status_bar`, workbench/status_entries.rs; cargo test -p app f6_in_an_editor_window_reaches_its_own_status_bar) |-| workbench/services/lifecycle | workbench service | M11 | ported | [3 M] unattendedRestart.ts: `IUnattendedRestartService` with its participants (debugLifecycle.ts, task.contribution.ts, testingContinuousRunService.ts `testing.continuousRun`) and platform/update's `UnattendedRestartScheduler` (restart to update while the screen is locked) not ported | workbench/lifecycle.rs: ShutdownReason, onBeforeShutdown vetoes on quit, close button, closeWindow, reload and load (`window.confirmBeforeClose`, backup tracker auto save, hot exit, showSaveConfirm); cargo test -p app lifecycle; no phases or onWillShutdown joiners; verified: cargo test -p app backup_tracker lifecycle (workingCopyBackupTracker.test.ts); ui-pair hot-exit.json `dirty`, `restored` vs the reference (port/results/windows.md, milestone 11 verification) |+| workbench/services/lifecycle | workbench service | M11 | ported | [3 L] unattendedRestart.ts: `IUnattendedRestartService` with its participants (unattendedRestartParticipants.ts, terminalUnattendedRestart.ts, testingUnattendedRestart.ts, webviewUnattendedRestart.ts, notebookUnattendedRestart.ts, debugLifecycle.ts, task.contribution.ts, workingCopyBackupTracker.ts, testingContinuousRunService.ts `testing.continuousRun`, window.ts `cli.waitingForEditorClose`), platform/update's `UnattendedRestartScheduler` (restart to update while the screen is locked, with `update.restartWhenIdle` on) and windowsStateHandler.ts `setNextExactRestore` not ported | workbench/lifecycle.rs: ShutdownReason, onBeforeShutdown vetoes on quit, close button, closeWindow, reload and load (`window.confirmBeforeClose`, backup tracker auto save, hot exit, showSaveConfirm); cargo test -p app lifecycle; no phases or onWillShutdown joiners; verified: cargo test -p app backup_tracker lifecycle (workingCopyBackupTracker.test.ts); ui-pair hot-exit.json `dirty`, `restored` vs the reference (port/results/windows.md, milestone 11 verification) || workbench/services/localTranscription | workbench service | | removed | | no AI or Microsoft services by decision (port/notes.md); API stays inert || workbench/services/localization | workbench service | M18 | verified | | ui-pair port/fixtures/extensions/ui-display-language.json: picking Deutsch installs MS-CEINTL.vscode-language-pack-de with the "Installing Deutsch language support..." progress and asks "Restart VSRustium to switch to Deutsch?"; localeService.ts: argv.json `locale` written and cleared, restart dialog, install of an MS-CEINTL pack: cargo test -p app nls localization; Command Palette titles, categories and descriptions translate by the reference call's module and key (port/tools/ref-commands with ref-nls-clone.ts; cargo test -p app a_palette_title_two_modules), menu bar items, side bar titles and pane headers by the reference's `nlsKeys` per menu, view and container (cargo test -p app menu_bar_items_and_view_titles_resolve_per_scope); other surfaces stay English (port/notes.md) || workbench/services/log | workbench service | M6 | verified | | output/log_levels.rs: defaultLogLevels.ts argv.json `log-level` read and write, `getDefaultLogLevel`, `parseLogLevel`; logs_actions.rs `setDefaultLogLevel` (cargo test -p app set_default_log_level_writes_argv, reads_and_writes_argv_log_levels); the Window log as logConstants.ts `windowLogId`; electron-browser logService.ts in a test run: the host console reaches stdout/stderr through the session; output/log_levels.rs: defaultLogLevels.ts argv.json `log-level` read and write, `getDefaultLogLevel`, `parseLogLevel`; logs_actions.rs `setDefaultLogLevel` (cargo test -p app set_default_log_level_writes_argv, reads_and_writes_argv_log_levels); the Window log as logConstants.ts `windowLogId` |@@@ -473,9 -473,9 +473,9 @@@| workbench/contrib/codeActions | workbench contribution | M13 | verified | | codeActionsContribution.ts `updateConfigurationSchema`: every provided `source` kind gets its property in `editor.codeActionsOnSave` and `notebook.codeActionsOnSave` (config registry.rs `list_code_actions_on_save`, cargo test -p config code_actions_on_save). The keybindings schema (config json_schema.rs `keybindings_schema`, served at `vscode://schemas/keybindings` with `vscode://schemas/inlineCompletionProviderIdArgs`) adds the extensions' commands and the provided kinds to `editor.action.codeAction`, `refactor` and `sourceAction` args: cargo test -p config json_schema; ui-pair user keybindings.json `editor.action.refactor` with `{}` args: "Missing property \"kind\"." at Ln 3, Col 60 in both (port/results/language-features.md Keybindings schema) || workbench/contrib/codeEditor | workbench contribution | M8 | verified | | quickaccess/gotoLineQuickAccess (Go to Line/Column, Go to Offset) ported; toggleRenderWhitespace's View: Toggle Render Whitespace and toggleMinimap's View: Toggle Minimap with `editor.minimap.enabled` (workbench/editor_commands.rs, ui-pair notes.txt); toggleColumnSelection's Toggle Column Selection Mode with its Selection menu check, and `editor.columnSelection` drags and Shift+clicks selecting a column (cargo test -p app column_selection_mode); toggleMultiCursorModifier's Toggle Multi-Cursor Modifier and its Selection menu items, with `editor.multiCursorModifier` `ctrlCmd` making Cmd+click the multi-cursor click (cargo test -p app multi_cursor_modifier); saveParticipants' text participants (cargo test -p app save_participants) and `CodeActionOnSaveParticipant` with `editor.codeActionsOnSave` before formatting (workbench/code_actions/on_save.rs: cargo test -p app code_actions), its `triggerCodeActionsCommand` running the `always` source kinds on window focus and active editor changes with `editor.codeActions.triggerOnFocusChange` and `files.autoSave` `afterDelay` (cargo test -p app a_window_focus_change_runs_the_always_code_actions_on_save); toggleOvertype's Toggle Overtype/Insert Mode with typing, IME composition and `editor.overtypeOnPaste` paste overtyping, its OVR status item and block cursor (cargo test -p app overtype_mode; ui-pair notes.txt); toggleRenderControlCharacter's Toggle Control Characters (workbench/editor_commands.rs); largeFileOptimizations' prompt with Forcefully Enable Features and Don't Show Again, and `isTooLargeForTokenization` turning off tokens, folding, word and selection highlights and sticky scroll (workbench/large_file.rs: cargo test -p app large_file); editorLineNumberMenu's `editor/lineNumber/context` menu with `editorLineNumber` (cargo test -p app the_line_number_menu); toggleWordWrap's View: Toggle Word Wrap (Alt+Z), View > Word Wrap and the long-lines editor title action over `editor.wordWrap` wrapping (editor/word_wrap.rs: cargo test -p app word_wrap, the monospaceLineBreaksComputer.test.ts cases; ui-pair wrap.ts); inspectEditorTokens with the semantic token's table from the first document or range provider (workbench/inspect_tokens.rs: cargo test -p app inspect_tokens a_semantic_token_adds_its_table_and_strikes_the_textmate_rule_it_overrides, a fresh tokenization past the line length limit: a_line_past_the_tokenization_limit_is_tokenized_for_the_inspector), the editor accessibility help (workbench/accessible_view.rs), quickaccess/gotoSymbolQuickAccess and the outline (workbench/quick_access/goto_symbol.rs, workbench/outline_pane.rs: cargo test -p app goto_symbol outline_pane); emptyTextEditorHint without its inline chat parts (workbench/empty_editor_hint.rs: cargo test -p app empty_editor_hint; ui-pair port/fixtures/ui-steps/empty-editor-hint.json: same text, links, italics and wrap at the editor width); diffEditorHelper.ts: the "Show Whitespace Differences" button of a whitespace-only diff and the "The diff algorithm was stopped early" prompt with Remove Limit (workbench/editor_view/diff_editor_view.rs: cargo test -p app a_whitespace_only_diff_offers_to_show_whitespace a_diff_stopped_early_offers_to_remove_the_limit; ui-pair port/fixtures/diff-whitespace/steps.json: the same button, then the same whitespace diff with the toggled action and the cursor left at Ln 1, Col 1). Removed by decision: dictation and the voice parts (AI), diffEditorTryout (an experiment), startDebugTextMate (a developer tool), menuPreventer and selectionClipboard (Linux), and Electron's displayChangeRemeasureFonts and sleepResumeRepaintMinimap workarounds. editorSettingsMigration and diffEditorHelper's `collapseUnchangedRegions` migration through ConfigurationMigrationWorkbenchContribution: every migrateOptions.ts item rewritten in user, workspace and multi-root folder settings and their `[language]` blocks, at startup and when folders are added (workbench/configuration_migration.rs: cargo test -p app configuration_migration). emptyEditorHintActions without its chat rows: the experimental `workbench.editor.experimental.emptyEditorHintActions` list with Select a Language, the editor last picked from the hint or the Markdown Editor matched through `getResourceForPatternMatching`, the split editor picker, Escape and the aria label (workbench/empty_editor_hint/actions.rs: cargo test -p app the_actions_hint_offers_the_last_picked_editor_first_and_escape_closes_it the_list_fits_the_editor_or_gives_way_to_the_classic_hint; ui-pair port/fixtures/ui-steps/empty-editor-hint.json with the setting on: the same rows, keys and footer) || 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 | ported | [3 M] comment_thread_widget.rs:5, :29, comments_view.rs:4, comment_navigation.rs:3: several forms; body line height; thread menus, filter highlights and history, a markdown preview's image shows its alt text, not "Image: {alt}"; focus and whole-line ranges | 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, the filter box with Show Resolved/Unresolved and Sort By, Collapse/Expand All, row selection and keys; hideIfEmpty), 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, 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) 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/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 | ported | [3 M] custom_editors.rs:637: a custom text editor's resource in two groups shares one 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 L] Disassembly view: not ported <br> [3 L] extensionHost launch type: not ported <br> [3 L] debug hover, inline values: debugHover.ts (`$provideEvaluatableExpression`, evaluate on hover) and the `debug.inlineValues` decorations (`$provideInlineValues`) | 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); shortcuts in port/notes.md |+| workbench/contrib/debug | workbench contribution | M16 | ported | [3 L] Disassembly view: not ported <br> [3 L] extensionHost launch type: not ported <br> [3 L] debug hover: debugHover.ts (`$provideEvaluatableExpression`, evaluate on hover) | 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); 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 |