Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(editor): skip lines without accurate tokens in comment and trim

rokartur58cf8567dfa2
diff --git a/native/crates/app/src/editor/comment.rs b/native/crates/app/src/editor/comment.rs
index 550834bdb7f..3d9d35b6a5e 100644
--- a/native/crates/app/src/editor/comment.rs
+++ b/native/crates/app/src/editor/comment.rs
@@ -41,12 +41,12 @@ impl OpenEditor {
change
}
- /// The comment tokens of the language at a position (`getLanguageIdAtPosition`), an embedded one included.
- // shortcut: the line is tokenized when needed, where upstream's `tokenizeIfCheap` skips long or far lines.
+ /// The comment tokens of the language at a position (`tokenizeIfCheap` and `getLanguageIdAtPosition`), an
+ /// embedded one included.
fn comments_at<'a>(&self, languages: &'a Languages, line: usize, column: usize) -> Comments<'a> {
let text = &self.document().lines[line];
let offset = text.char_indices().nth(column).map_or(text.len(), |(offset, _)| offset);
- match self.document().tokens.language_at(&self.document().lines, line, offset) {
+ match self.document().tokens.language_at_if_cheap(&self.document().lines, line, offset) {
Some(language) => languages.comments(&language),
None => languages.comments(&self.document().language_id),
}
diff --git a/native/crates/app/src/editor/indentation.rs b/native/crates/app/src/editor/indentation.rs
index 07f364df288..ba42912973d 100644
--- a/native/crates/app/src/editor/indentation.rs
+++ b/native/crates/app/src/editor/indentation.rs
@@ -3,6 +3,7 @@
use super::edit::command;
use super::{ContentChanged, Indentation, OpenEditor, Position, guess_indentation, indent_guides};
+use crate::syntax::Tokenization;
impl OpenEditor {
/// `model.updateOptions`: the indent guides follow the new sizes.
@@ -38,12 +39,7 @@ impl OpenEditor {
pub fn trim_trailing_whitespace(&mut self, trim_in_regex_and_strings: bool) -> Option<ContentChanged> {
let document = self.document();
let (lines, tokens) = (&document.lines, &document.tokens);
- let in_string_or_regex = |line: usize, offset: usize| {
- use textmate::StandardTokenType::{RegEx, String};
- // shortcut: the line is tokenized when needed, where upstream skips lines without accurate tokens.
- matches!(tokens.token_type_at(lines, line, offset), String | RegEx)
- };
- let edits = trim_trailing_whitespace_edits(lines, &[], |line, offset| !trim_in_regex_and_strings && in_string_or_regex(line, offset));
+ let edits = trim_trailing_whitespace_edits(lines, &[], |line, offset| !trim_in_regex_and_strings && in_string_or_untokenized(tokens, lines, line, offset));
drop(document);
self.push_undo_stop();
let change = self.execute_edits_tracking_primary(edits, command("editor.action.trimTrailingWhitespace"));
@@ -85,6 +81,13 @@ fn indentation_edits(lines: &[String], tab_size: usize, to_spaces: bool) -> Vec<
edits
}
+/// trimTrailingWhitespaceCommand.ts without `trimInRegexesAndStrings`: whitespace stays on a line without accurate
+/// tokens, which is not tokenized for it, and where it starts in a string or regex.
+pub(super) fn in_string_or_untokenized(tokens: &Tokenization, lines: &[String], line: usize, offset: usize) -> bool {
+ use textmate::StandardTokenType::{RegEx, String};
+ !tokens.has_accurate_tokens_for_line(lines, line) || matches!(tokens.token_type_at(lines, line, offset), String | RegEx)
+}
+
/// `trimTrailingWhitespace`: deletes each line's trailing whitespace, not left of a cursor on the line (the last
/// cursor of a line counts), and not where `keep(line, byte offset)` holds.
pub(super) fn trim_trailing_whitespace_edits(lines: &[String], cursors: &[Position], keep: impl Fn(usize, usize) -> bool) -> Vec<(Position, Position, String)> {
@@ -176,6 +179,22 @@ mod tests {
assert_eq!(edits, [(Position::new(2, 2), Position::new(2, 4), String::new())]);
}
+ /// trimTrailingWhitespaceCommand.ts: a line without accurate tokens keeps its whitespace rather than being tokenized.
+ #[test]
+ fn trim_skips_lines_without_accurate_tokens() {
+ let app_root = std::path::Path::new(env!("VSCODE_SRC")).to_path_buf();
+ let languages = crate::languages::Languages::new(&[exthost::scan::scan_extension(&app_root.join("extensions/typescript-basics"), true).unwrap()]);
+ let mut model = editor("a; \nb; ", "\n");
+ model.document_mut().tokens = Tokenization::new(languages.grammars.grammar("typescript"));
+ model.trim_trailing_whitespace(false);
+ assert_eq!(model.document().lines, ["a; ", "b; "]);
+ let document = model.document();
+ document.tokens.token_type_at(&document.lines, 0, 0);
+ drop(document);
+ model.trim_trailing_whitespace(false);
+ assert_eq!(model.document().lines, ["a;", "b; "]);
+ }
+
#[test]
fn trim_keeps_the_primary_selection() {
let mut model = editor("a \nb\t", "\n");
diff --git a/native/crates/app/src/editor/save_participants.rs b/native/crates/app/src/editor/save_participants.rs
index e7049b80934..2dd213bc0a1 100644
--- a/native/crates/app/src/editor/save_participants.rs
+++ b/native/crates/app/src/editor/save_participants.rs
@@ -2,7 +2,7 @@
//! the order `SaveParticipantsContribution` registers them; the selections stay as they were before the save.
use super::edit::EditReason;
-use super::indentation::trim_trailing_whitespace_edits;
+use super::indentation::{in_string_or_untokenized, trim_trailing_whitespace_edits};
use super::{ContentChanged, OpenEditor, Position};
/// The `files.*` settings of the model's language and resource that turn each participant on.
@@ -36,10 +36,7 @@ impl OpenEditor {
fn trim_trailing_whitespace_on_save(&mut self, trim_in_regex_and_strings: bool, spared_cursors: &[Position]) -> Option<ContentChanged> {
let document = self.document();
let (lines, tokens) = (&document.lines, &document.tokens);
- let keep = |line: usize, offset: usize| {
- use textmate::StandardTokenType::{RegEx, String};
- !trim_in_regex_and_strings && matches!(tokens.token_type_at(lines, line, offset), String | RegEx)
- };
+ let keep = |line: usize, offset: usize| !trim_in_regex_and_strings && in_string_or_untokenized(tokens, lines, line, offset);
let edits = trim_trailing_whitespace_edits(lines, spared_cursors, keep).into_iter().map(|(start, end, text)| (start, end, text, false)).collect();
drop(document);
self.execute_edits(edits, Some(self.selections.clone()), EditReason::Unknown("trimTrailingWhitespace"))
diff --git a/native/crates/app/src/syntax.rs b/native/crates/app/src/syntax.rs
index cb3cbb82ccb..da0a80ef538 100644
--- a/native/crates/app/src/syntax.rs
+++ b/native/crates/app/src/syntax.rs
@@ -261,18 +261,50 @@ impl Tokenization {
pub fn language_at(&self, lines: &[String], index: usize, offset: usize) -> Option<std::rc::Rc<str>> {
self.grammar.as_ref()?;
self.tokenize_to(lines, index);
+ self.stored_language_at(index, offset)
+ }
+
+ /// `tokenizeIfCheap` then `getLanguageIdAtPosition`: a line past the cheap one is read with the tokens it has.
+ pub fn language_at_if_cheap(&self, lines: &[String], index: usize, offset: usize) -> Option<std::rc::Rc<str>> {
+ self.grammar.as_ref()?;
+ if self.is_cheap_to_tokenize(lines, index) {
+ self.tokenize_to(lines, index);
+ }
+ self.stored_language_at(index, offset)
+ }
+
+ fn stored_language_at(&self, index: usize, offset: usize) -> Option<std::rc::Rc<str>> {
let tokenized = self.lines.borrow();
let tokens = &tokenized.tokens[index];
tokens.iter().find(|token| token.end > offset).or(tokens.last()).and_then(|token| token.scopes.language.clone())
}
+ /// textModelTokens.ts `hasAccurateTokensForLine`: line `index` is before the first one with an untrusted end state.
+ pub fn has_accurate_tokens_for_line(&self, lines: &[String], index: usize) -> bool {
+ self.first_untrusted_line(lines).is_none_or(|first_untrusted| index < first_untrusted)
+ }
+
+ /// `getFirstInvalidEndStateLineNumber`: the first line waiting for its tokens, none once every line has them.
+ pub fn first_untrusted_line(&self, lines: &[String]) -> Option<usize> {
+ self.grammar.as_ref()?;
+ self.synced(lines).invalid.min()
+ }
+
/// `getStandardTokenType` of the token at byte `offset` of line `index` (`findTokenIndexAtOffset`).
pub fn token_type_at(&self, lines: &[String], index: usize, offset: usize) -> textmate::StandardTokenType {
+ if self.grammar.is_some() {
+ self.tokenize_to(lines, index);
+ }
+ self.stored_token_type_at(lines, index, offset)
+ }
+
+ /// `getLineTokens(...).getStandardTokenType`: the type at byte `offset` from the tokens line `index` has, which a
+ /// line not tokenized yet has none of.
+ pub fn stored_token_type_at(&self, lines: &[String], index: usize, offset: usize) -> textmate::StandardTokenType {
if self.grammar.is_none() {
return textmate::StandardTokenType::Other;
}
- self.tokenize_to(lines, index);
- let tokenized = self.lines.borrow();
+ let tokenized = self.synced(lines);
let tokens = &tokenized.tokens[index];
tokens.iter().find(|token| token.end > offset).or(tokens.last()).map_or(textmate::StandardTokenType::Other, |token| token.token_type)
}
@@ -771,6 +803,22 @@ mod tests {
assert_eq!(tokens.line_tokens(&lines, 2).iter().find(|(_, token_type, _)| *token_type == textmate::StandardTokenType::Comment), None);
}
+ /// `tokenizeIfCheap` tokenizes only the first untrusted line; a line past it is read with the tokens it has and
+ /// keeps no accurate tokens (`hasAccurateTokensForLine`).
+ #[test]
+ fn only_the_first_untrusted_line_is_cheap_to_tokenize() {
+ let extensions = exthost::scan::scan_builtin_extensions(&Path::new(env!("VSCODE_SRC")).join("extensions")).unwrap();
+ let languages = Languages::new(&extensions);
+ let lines: Vec<String> = ["let a = 1;", "let b = 2;", "let c = 3;"].map(String::from).into();
+ let tokens = Tokenization::new(languages.grammars.grammar("typescript"));
+ tokens.language_at_if_cheap(&lines, 2, 0);
+ assert!(!tokens.has_accurate_tokens_for_line(&lines, 0));
+ tokens.language_at_if_cheap(&lines, 0, 0);
+ assert!(tokens.has_accurate_tokens_for_line(&lines, 0));
+ assert!(!tokens.has_accurate_tokens_for_line(&lines, 1));
+ assert!(Tokenization::new(None).has_accurate_tokens_for_line(&lines, 2));
+ }
+
/// textModelTokens.ts `tokenizeHeuristically`: lines in view far below the tokenized ones get their tokens from a
/// state guessed from the less indented lines above, without the lines between; the background tokenizes them again.
#[test]
@@ -808,8 +856,9 @@ mod tests {
}
/// Typing latency on a 52k-line TypeScript file (textModel.ts repeated): the median per edit of one typed char
- /// then the tokens of 60 visible lines and the bracket match, at lines 100, 25000 and 49000; the gate is 16 ms.
- /// Run in release: `cargo test --release -p app -- --ignored typing_latency_on_a_large_file --nocapture`.
+ /// then the tokens of 60 visible lines, the bracket match, the section headers and the unicode highlights, at lines
+ /// 100, 25000 and 49000; the gate is 16 ms. Also the gates of port/notes.md "Scheduling differences".
+ /// Run in release: `cargo gc test --release -p app -- --ignored typing_latency_on_a_large_file --nocapture`.
#[test]
#[ignore]
fn typing_latency_on_a_large_file() {
@@ -829,13 +878,33 @@ mod tests {
let mut group = crate::editor::EditorGroup::default();
group.open(document, false);
let editor = group.active_mut().unwrap();
+ let unicode_options = crate::editor::unicode_highlighter::UnicodeHighlighterOptions {
+ non_basic_ascii: false,
+ ambiguous_characters: true,
+ invisible_characters: true,
+ include_comments: false,
+ include_strings: true,
+ allowed_code_points: Vec::new(),
+ allowed_locales: vec!["en".into()],
+ };
let frame = |editor: &crate::editor::OpenEditor, line: usize, column: usize| {
- let lines = &editor.document().lines;
- editor.document().tokens.tokenize_viewport(lines, line.saturating_sub(30), line + 29);
+ let document = editor.document();
+ let lines = &document.lines;
+ document.tokens.tokenize_viewport(lines, line.saturating_sub(30), line + 29);
for index in line.saturating_sub(30)..(line + 30).min(lines.len()) {
- editor.document().tokens.highlights(&theme, &languages, lines, index, 4);
+ document.tokens.highlights(&theme, &languages, lines, index, 4);
}
- editor.document().tokens.bracket_match(&theme, &languages, lines, (line, column));
+ document.tokens.bracket_match(&theme, &languages, lines, (line, column));
+ // The workbench's section headers (minimap_view.rs `section_headers`) and unicode highlights of each model version.
+ let find = crate::editor::section_headers::FindOptions {
+ region_start: document.folding_markers.as_deref().map(|markers| &markers.start_with_flags),
+ mark_regex: Some(crate::editor::section_headers::MARK_SECTION_HEADER_REGEX),
+ block_comment: document.block_comment.as_ref().map(|(start, end)| (start.as_str(), end.as_str())),
+ };
+ for header in crate::editor::section_headers::find_section_headers(lines, &find).iter().filter(|header| header.should_be_in_comments) {
+ document.tokens.stored_token_type_at(lines, header.start.line, 0);
+ }
+ crate::editor::unicode_highlighter::compute_unicode_highlights(lines, 0, &unicode_options);
};
let background = |editor: &mut crate::editor::OpenEditor| {
let mut document = editor.document_mut();
@@ -865,7 +934,37 @@ mod tests {
eprintln!("line {line}: median {:.2} ms, max {:.2} ms", times[5], times[10]);
medians.push(times[5]);
}
+ // bracketSelections.ts yields after `_maxDuration` (30 ms): a scan under it gives upstream's ranges.
+ let mut bracket_scans = Vec::new();
+ for line in [100, 25_010, 49_010] {
+ editor.type_text("x").unwrap();
+ background(editor);
+ let position = crate::editor::Position::new(line, 9);
+ editor.bracket_selection_ranges(&languages, position);
+ let start = Instant::now();
+ editor.bracket_selection_ranges(&languages, position);
+ bracket_scans.push(start.elapsed().as_secs_f64() * 1000.);
+ }
+ eprintln!("bracket selection scans {bracket_scans:.2?} ms");
+ // `tokenizeIfCheap` and `hasAccurateTokensForLine`: on a file just opened, trim and comment tokenize no far lines.
+ std::fs::write(&path, &text).unwrap();
+ let document = crate::editor::TextDocument::read(&path, &languages, &crate::default_settings().lock().unwrap()).unwrap();
+ std::fs::remove_file(&path).unwrap();
+ let mut group = crate::editor::EditorGroup::default();
+ group.open(document, false);
+ let editor = group.active_mut().unwrap();
+ frame(editor, 0, 0);
+ editor.move_to(crate::editor::Position::new(49_000, 0), false);
+ let start = Instant::now();
+ editor.trim_trailing_whitespace(false);
+ let trim = start.elapsed().as_secs_f64() * 1000.;
+ let start = Instant::now();
+ editor.comment_lines(crate::editor::LineCommentKind::Toggle, true, true, &languages);
+ let comment = start.elapsed().as_secs_f64() * 1000.;
+ eprintln!("on a file just opened: trim {trim:.2} ms, comment at line 49000 {comment:.2} ms");
assert!(medians.iter().all(|&median| median < 16.), "medians {medians:?} ms, the gate is 16 ms");
+ assert!(bracket_scans.iter().all(|&scan| scan < 30.), "bracket selection scans {bracket_scans:?} ms, upstream yields at 30 ms");
+ assert!(trim < 16. && comment < 16., "trim {trim} ms, comment {comment} ms, the gate is 16 ms");
}
/// Every colorize-tests fixture gives the reference's tokens, scopes and, in each default theme, colors.
diff --git a/port/ledger.md b/port/ledger.md
index dfff8fdcdb0..35c8f538f1b 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -350,7 +350,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| editor/contrib/codeAction | src/vs/editor/contrib | M13 | verified | | On line 1 a breakpoint, stack frame or test glyph keeps the light bulb inline (lightBulbWidget.ts `hasDecoration`): cargo test -p app a_glyph_on_line_1_keeps_the_light_bulb_inline. workbench/code_actions.rs and the action widget view workbench/action_widget.rs: automatic requests and the light bulb, Cmd+. and the kind commands with auto apply, the grouped menu, the marker hover's Quick Fix..., `_executeCodeActionProvider`: cargo test -p app code_actions. The widget takes the focus, typed keys navigate its list and it hides on blur: cargo test -p app the_action_widget_takes_the_keys_and_hides_on_blur. The marker hover's AI entry and menu actions are removed by decision (port/notes.md "Copilot Chat"). The whole workspace edit applies, through the Refactor Preview for `previewSelectedCodeAction` and edits that need confirmation; ui-pair steps-params-actions.json (port/results/language-features.md): the Cmd+. menu matches |
| editor/contrib/codelens | src/vs/editor/contrib | M13 | verified | | workbench/code_lens.rs: lenses in view zones above their lines, resolve in view, commands, `codelens.showLensesInCurrentLine`, `_executeCodeLensProvider`, `CodeLensCache` (code_lens::tests::a_model_shown_again_draws_its_cached_lenses_at_once), `editor.codeLensFontFamily` and the fade in (lenses_take_their_font_setting_and_fade_in_when_resolved), the refresh on focus (the_editor_focus_asks_for_lenses_again): cargo test -p app code_lens view_zones; merge-conflict lenses match the reference (port/results/scm.md); workbench/code_lens.rs: lenses in view zones above their lines, resolve in view, commands, `codelens.showLensesInCurrentLine`, `_executeCodeLensProvider` with cancellable requests: cargo test -p app code_lens view_zones |
| editor/contrib/colorPicker | src/vs/editor/contrib | M13 | verified | | workbench/color_detector.rs (colorDetector.ts, boxes as injected text, `editor.colorDecorators*`, `editor.defaultColorDecorators`, the 'Document Colors' debounce of language_feature_debounce.rs: color_detector::tests::the_delay_follows_the_providers_answer_time), default_document_colors.rs (defaultDocumentColorsComputer.ts), workbench/color_picker.rs (hover participant and picker widget), workbench/standalone_color_picker.rs (focus: standalone_color_picker::tests::showing_the_picker_again_focuses_it, the_focus_leaving_the_picker_hides_it): cargo test -p app default_document_colors color_picker (defaultDocumentColorProvider.test.ts cases); ui-pair port/fixtures/language-features/steps-color.json (port/results/inlay-hints.md). colorPickerPointerMonitor.test.ts (DOM pointer capture) and colorDetector.test.ts (CSS variables on the editor container) have no counterpart |
-| editor/contrib/comment | src/vs/editor/contrib | M8 | verified | [scheduling L] minimap.rs:87; minimap_view.rs:432; unicode_highlight.rs:63; indentation.rs:43; comment.rs:45; smart_select.rs:292: sticky minimap sampling, worker section headers and unicode highlights, tokenizeIfCheap, the 30 ms smart select yield. Accepted as "Scheduling differences" only with a measured same result and typing on a 50k-line TS file under 16 ms per edit; otherwise class 3. Audit inputs at 5e5b1b0a915. | `editor/comment.rs`: line and block comment commands over a `CommandExecutor` port, Toggle/Add/Remove Line Comment and Toggle Block Comment with their keys, Edit menu rows and palette entries; cargo test -p app editor::comment (lineCommentCommand.test.ts, blockCommentCommand.test.ts) comment_keys menubar; ui-pair Cmd+/ and Shift+Alt+A match the reference (port/notes.md milestone 8) |
+| editor/contrib/comment | src/vs/editor/contrib | M8 | verified | | `editor/comment.rs`: line and block comment commands over a `CommandExecutor` port, Toggle/Add/Remove Line Comment and Toggle Block Comment with their keys, Edit menu rows and palette entries; cargo test -p app editor::comment (lineCommentCommand.test.ts, blockCommentCommand.test.ts) comment_keys menubar; ui-pair Cmd+/ and Shift+Alt+A match the reference (port/notes.md milestone 8) |
| editor/contrib/contextmenu | src/vs/editor/contrib | M8 | verified | | right click on text or below the last line: focus, cursor to the pointer unless a selection holds it, `MenuId.EditorContext` with the navigation, Peek, Rename, Format, Change All Occurrences, Refactor... and Source Action... (shown for the kinds in `supportedCodeAction`), Cut, Copy, Paste and Command Palette... items (port/results/contextmenu.md, cargo test -p app editor_menus, cargo test -p app refactor_and_source_action); the scrollbar and minimap menu (`_showScrollbarContextMenu`, Vertical size, Slider and Side as submenus: cargo test -p app the_scrollbar_menu_writes_the_minimap_settings); Show Editor Context Menu (Shift+F10) below the cursor (cargo test -p app shift_f10) |
| editor/contrib/cursorUndo | src/vs/editor/contrib | M8 | verified | | Cursor Undo (Cmd+U) and Cursor Redo over the selections and scroll positions of cursor-only changes, cleared by an edit or another shown model: cargo test -p app cursor_undo (both cursorUndo.test.ts cases); ui-pair on a .ts file matches the reference |
| editor/contrib/diffEditorBreadcrumbs | src/vs/editor/contrib | M14 | verified | | the outline of the modified model (every `$provideDocumentSymbols` provider) feeds the breadcrumbs of collapsed unchanged regions (diff_editor/unchanged_regions.rs `breadcrumb_items`): cargo test -p app breadcrumbs_name_the_symbols |
@@ -368,7 +368,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| editor/contrib/gpu | src/vs/editor/contrib | | removed | | Artur: internal infrastructure or developer tool with no 1:1 counterpart in the native port |
| editor/contrib/hover | src/vs/editor/contrib | M13 | verified | | workbench/content_hover.rs, workbench/content_hover_view.rs, workbench/accessible_view.rs (hoverAccessibleViews.ts): cargo test -p app content_hover; ui-pair hover on src/main.ts. The color picker part is workbench/color_picker.rs, the inlay hint tooltip workbench/inlay_hints.rs |
| editor/contrib/inPlaceReplace | src/vs/editor/contrib | M8 | verified | | Replace with Previous/Next Value (Shift+Cmd+, and ., palette): number step and value sets of `navigateValueSet`, 350 ms outline in light themes; cargo test -p app editor::in_place_replace (upstream has no test); ui-pair light theme `x = true; y = 41; z = 1.5` from the palette |
-| editor/contrib/indentation | src/vs/editor/contrib | M8 | verified | [scheduling L] minimap.rs:87; minimap_view.rs:432; unicode_highlight.rs:63; indentation.rs:43; comment.rs:45; smart_select.rs:292: sticky minimap sampling, worker section headers and unicode highlights, tokenizeIfCheap, the 30 ms smart select yield. Accepted as "Scheduling differences" only with a measured same result and typing on a 50k-line TS file under 16 ms per edit; otherwise class 3. Audit inputs at 5e5b1b0a915. | indentation actions, trimTrailingWhitespaceCommand.ts, auto-indent on Enter, type and paste: cargo test -p app indentation editor_status editor::auto_indent (cursor.test.ts indent cases, shiftCommand.test.ts, indentation.test.ts; upstream's `test.skip` cases are `#[ignore]`, 13 ignored) |
+| editor/contrib/indentation | src/vs/editor/contrib | M8 | verified | | indentation actions, trimTrailingWhitespaceCommand.ts, auto-indent on Enter, type and paste: cargo test -p app indentation editor_status editor::auto_indent (cursor.test.ts indent cases, shiftCommand.test.ts, indentation.test.ts; upstream's `test.skip` cases are `#[ignore]`, 13 ignored) |
| editor/contrib/inlayHints | src/vs/editor/contrib | M13 | verified | | workbench/inlay_hints.rs over editor/injected_text.rs (the 'InlayHint' debounce: inlay_hints::tests::the_delay_follows_the_providers_answer_time; off a word a hint attaches after its token's start, `_getRangeAtPosition`: inlay_hints::tests::a_hint_off_a_word_attaches_after_the_start_of_its_token; inlayHintsController.ts: cache, fixed lengths while typing, label parts, links, tooltip resolve, double click edits, `editor.inlayHints.*`, `_executeInlayHintProvider`): cargo test -p app injected_text inlay_hints; ui-pair port/fixtures/language-features/steps-color.json (port/results/inlay-hints.md); cargo test -p app a_scroll_asks_nothing_while_hints_are_off |
| editor/contrib/inlineCompletions | src/vs/editor/contrib | M13 | verified | | workbench/inline_completions.rs, ghost_text.rs, workbench/suggest_controller.rs, workbench/suggest_widget.rs: cargo test -p app ghost_text inline_completions only_the_answer_with_the_suggest_item_augments_it items_with_the_same_trimmed_edit_cycle_as_one an_item_without_a_range_replaces_up_to_the_line_end the_hover_over_the_ghost_text_shows_the_inline_suggestion_toolbar (computeGhostText, getSecondaryEdits, inlineCompletions, suggestWidgetModel tests); cargo test -p diff lcs_diff; ui-pair port/fixtures/language-features/steps-ghost.json (port/results/inlay-hints.md), port/fixtures/ui-pair/menus/inline-completions-toolbar.json with `ARGS=--extensionDevelopmentPath=port/fixtures/extensions/menus`. Not ported: the telemetry test, the `test.skip` "Active" test, the DOM layout tests; inline edits and next edit suggestions are AI: removed; cargo test -p app the_always_shown_toolbar_sits_above_the_ghost_text the_chars_around_the_ghost_text a_hover_takes_the_char_under_the_mouse |
| editor/contrib/inlineProgress | src/vs/editor/contrib | M13 | verified | | workbench/inline_progress.rs (inlineProgress.ts): the spinner after 500 ms at the paste or drop position with 1em of room as injected text, its hover, click cancels; the paste falls back to the default paste: cargo test -p app paste_edits (the_paste_progress_makes_room_for_its_spinner); ui-pair d.md paste (no spinner once the provider answers, as in the reference) |