Skip to content

Visual Studio Code, rebuilt in Rust

Rust

feat(tasks): report the problem pattern and matcher parsers' messages

rokartur13b2e028c6b2
diff --git a/native/crates/app/src/extension_point_messages.rs b/native/crates/app/src/extension_point_messages.rs
index e1371eab4a3..6f6df3d11ae 100644
--- a/native/crates/app/src/extension_point_messages.rs
+++ b/native/crates/app/src/extension_point_messages.rs
@@ -159,7 +159,7 @@ fn icons(extensions: &[ScannedExtension]) {
}
}
-fn is_truthy(value: &Value) -> bool {
+pub fn is_truthy(value: &Value) -> bool {
match value {
Value::Null => false,
Value::Bool(value) => *value,
diff --git a/native/crates/app/src/tasks/problem_collector.rs b/native/crates/app/src/tasks/problem_collector.rs
index 229c26702b2..b9bfc8f9db2 100644
--- a/native/crates/app/src/tasks/problem_collector.rs
+++ b/native/crates/app/src/tasks/problem_collector.rs
@@ -402,7 +402,7 @@ mod tests {
if background {
description["background"] = json!({ "beginsPattern": "^start$", "endsPattern": "^end$" });
}
- registry.parse(&description).unwrap()
+ registry.parse(&description, &mut Vec::new()).unwrap()
}
#[test]
diff --git a/native/crates/app/src/tasks/problem_matcher.rs b/native/crates/app/src/tasks/problem_matcher.rs
index b15229df535..9e563999503 100644
--- a/native/crates/app/src/tasks/problem_matcher.rs
+++ b/native/crates/app/src/tasks/problem_matcher.rs
@@ -8,6 +8,12 @@ use std::sync::Arc;
use serde_json::{Value, json};
+use crate::extension_point_messages::is_truthy;
+use crate::notifications::Severity;
+
+/// What `ProblemPatternParser` and `ProblemMatcherParser` report, in order.
+pub type Messages = Vec<(Severity, String)>;
+
/// `MarkerSeverity`.
pub const SEVERITY_ERROR: u8 = 8;
pub const SEVERITY_WARNING: u8 = 4;
@@ -87,25 +93,38 @@ pub struct Registry {
}
impl Registry {
- /// The built-in patterns and matchers, then those the extensions contribute, in extension order.
- pub fn new(contributions: &[&Value]) -> Self {
+ /// The built-in patterns and matchers, then those the extensions (id, `contributes`) contribute, in extension
+ /// order; the parsers' messages are the extensions' messages.
+ pub fn new(contributions: &[(&str, &Value)]) -> Self {
let mut registry = Registry::default();
registry.fill_defaults();
- for contributes in contributions {
+ for (id, contributes) in contributions {
+ let report = |(severity, message): (Severity, String)| crate::perf::extension_point_message(id, severity, message);
+ // Upstream's `parser.reset()` cannot lower the reporter's state, so after one error every later pattern
+ // of the extension is ignored too.
+ let mut failed = false;
for pattern in contributes["problemPatterns"].as_array().into_iter().flatten() {
let Some(name) = pattern["name"].as_str() else { continue };
- let patterns = match &pattern["patterns"] {
- Value::Array(patterns) => parse_patterns(patterns),
- _ => parse_pattern(pattern, true).map(|pattern| vec![pattern]),
- };
- if let Some(patterns) = patterns {
+ let mut messages = Messages::new();
+ let patterns = parse_problem_pattern(pattern, &mut messages);
+ failed |= messages.iter().any(|(severity, _)| *severity == Severity::Error);
+ messages.into_iter().for_each(report);
+ if failed {
+ report((Severity::Error, "Invalid problem pattern. The pattern will be ignored.".into()));
+ report((Severity::Error, json_stringify(pattern)));
+ } else if let Some(patterns) = patterns {
registry.patterns.insert(name.to_owned(), patterns);
}
}
}
- for contributes in contributions {
+ for (id, contributes) in contributions {
for matcher in contributes["problemMatchers"].as_array().into_iter().flatten() {
- if let Some(parsed) = registry.parse(matcher)
+ let mut messages = Messages::new();
+ let parsed = registry.parse(matcher, &mut messages);
+ for (severity, message) in messages {
+ crate::perf::extension_point_message(id, severity, message);
+ }
+ if let Some(parsed) = parsed
&& let Some(name) = parsed.name.clone()
{
registry.matchers.insert(name, parsed);
@@ -125,7 +144,23 @@ impl Registry {
}
/// `ProblemMatcherParser.parse`: an object matcher, possibly based on a named one (`base`).
- pub fn parse(&self, description: &Value) -> Option<ProblemMatcher> {
+ pub fn parse(&self, description: &Value, messages: &mut Messages) -> Option<ProblemMatcher> {
+ let Some(mut result) = self.create_problem_matcher(description, messages) else {
+ messages.push((Severity::Error, format!("Error: the description can't be converted into a problem matcher:\n{}\n", json_stringify(description))));
+ return None;
+ };
+ if result.owner.is_empty() {
+ messages.push((Severity::Error, format!("Error: the description doesn't define an owner:\n{}\n", json_stringify(description))));
+ return None;
+ }
+ if let Some(watching) = parse_watching(description, messages) {
+ result.watching = Some(watching);
+ }
+ Some(result)
+ }
+
+ /// `createProblemMatcher`.
+ fn create_problem_matcher(&self, description: &Value, messages: &mut Messages) -> Option<ProblemMatcher> {
let owner = description["owner"].as_str().map(str::to_owned).unwrap_or_else(exthost::main_thread_storage::generate_uuid);
let source = description["source"].as_str().map(str::to_owned);
let apply_to = match description["applyTo"].as_str() {
@@ -135,13 +170,30 @@ impl Registry {
};
let (file_location, file_prefix, search) = parse_file_location(&description["fileLocation"]);
let patterns = match &description["pattern"] {
- Value::String(name) => name.strip_prefix('$').and_then(|name| self.patterns.get(name)).cloned(),
- Value::Array(patterns) => parse_patterns(patterns),
- Value::Object(_) => parse_pattern(&description["pattern"], true).map(|pattern| vec![pattern]),
+ Value::String(name) if name.len() > 1 && name.starts_with('$') => {
+ let patterns = self.patterns.get(&name[1..]).cloned();
+ if patterns.is_none() {
+ messages.push((Severity::Error, format!("Error: the pattern with the identifier {name} doesn't exist.")));
+ }
+ patterns
+ }
+ // An empty string is falsy: upstream does not parse it.
+ Value::String(name) if name.is_empty() => None,
+ Value::String(name) => {
+ messages.push((Severity::Error, format!("Error: the pattern property {name} is not a valid pattern variable name.")));
+ None
+ }
+ pattern if is_truthy(pattern) => parse_problem_pattern(pattern, messages),
_ => None,
};
- let severity = description["severity"].as_str().map(|severity| severity_from_value(severity).unwrap_or(SEVERITY_ERROR));
- let mut result = if let Some(base) = description["base"].as_str().and_then(|base| base.strip_prefix('$')) {
+ let severity = description["severity"].as_str().filter(|severity| !severity.is_empty()).map(|severity| {
+ severity_from_value(severity).unwrap_or_else(|| {
+ messages.push((Severity::Info, format!("Info: unknown severity {severity}. Valid values are error, warning and info.\n")));
+ SEVERITY_ERROR
+ })
+ });
+ let mut result = if let Some(base) = description["base"].as_str() {
+ let base = base.strip_prefix('$').filter(|name| !name.is_empty())?;
let mut result = self.matchers.get(base)?.clone();
if description["owner"].is_string() {
result.owner = owner;
@@ -181,9 +233,6 @@ impl Registry {
label: None,
}
};
- if let Some(watching) = parse_watching(description) {
- result.watching = Some(watching);
- }
if let Some(name) = description["name"].as_str() {
result.name = Some(name.to_owned());
result.label = Some(description["label"].as_str().unwrap_or(name).to_owned());
@@ -282,11 +331,90 @@ fn set_field(pattern: &mut Pattern, field: &str, index: usize) {
*slot = Some(index);
}
+/// `ProblemPatternParser.parse`: a named multi-line pattern, a list of patterns or one pattern, each with a
+/// `regexp` string.
+fn parse_problem_pattern(value: &Value, messages: &mut Messages) -> Option<Vec<Pattern>> {
+ let checked = |values: &Vec<Value>| values.iter().all(|value| value["regexp"].is_string());
+ if value["name"].is_string()
+ && let Some(values) = value["patterns"].as_array().filter(|values| checked(values))
+ {
+ return parse_multi_line_pattern(values, messages);
+ }
+ if let Some(values) = value.as_array().filter(|values| checked(values)) {
+ return parse_multi_line_pattern(values, messages);
+ }
+ if value["regexp"].is_string() {
+ let pattern = parse_pattern(value, true, messages)?;
+ return validate_patterns(std::slice::from_ref(&pattern), messages).then(|| vec![pattern]);
+ }
+ messages.push((Severity::Error, "The problem pattern is missing a regular expression.".into()));
+ None
+}
+
+/// `createMultiLineProblemPattern`: no defaults; only the last pattern may loop.
+fn parse_multi_line_pattern(values: &[Value], messages: &mut Messages) -> Option<Vec<Pattern>> {
+ let mut patterns = Vec::new();
+ for (index, value) in values.iter().enumerate() {
+ let mut pattern = parse_pattern(value, false, messages)?;
+ if index + 1 < values.len() && pattern.loop_ {
+ pattern.loop_ = false;
+ messages.push((Severity::Error, "The loop property is only supported on the last line matcher.".into()));
+ }
+ patterns.push(pattern);
+ }
+ if patterns.is_empty() {
+ messages.push((Severity::Error, "The problem pattern is invalid. It must contain at least one pattern.".into()));
+ return None;
+ }
+ validate_patterns(&patterns, messages).then_some(patterns)
+}
+
+/// `validateProblemPattern`; a `kind: "file"` after the first pattern is not reported, its kind `File` being 0.
+fn validate_patterns(patterns: &[Pattern], messages: &mut Messages) -> bool {
+ let (mut file, mut message, mut location, mut line) = (false, false, false, false);
+ for (index, pattern) in patterns.iter().enumerate() {
+ if index != 0 && pattern.location_kind {
+ messages.push((Severity::Error, "The problem pattern is invalid. The kind property must be provided only in the first element".into()));
+ }
+ file |= pattern.file.is_some();
+ message |= pattern.message.is_some();
+ location |= pattern.location.is_some();
+ line |= pattern.line.is_some();
+ }
+ if !(file && message) {
+ messages.push((Severity::Error, "The problem pattern is invalid. It must have at least have a file and a message.".into()));
+ return false;
+ }
+ if !patterns[0].file_kind && !(location || line) {
+ messages.push((Severity::Error, "The problem pattern is invalid. It must either have kind: \"file\" or have a line or location match group.".into()));
+ return false;
+ }
+ true
+}
+
+/// `createRegularExpression`.
+fn regular_expression(value: &str, messages: &mut Messages) -> Option<Arc<onig::Regex>> {
+ match onig::Regex::new(value) {
+ Ok(regexp) => Some(Arc::new(regexp)),
+ Err(_) => {
+ messages.push((Severity::Error, format!("Error: The string {value} is not a valid regular expression.\n")));
+ None
+ }
+ }
+}
+
+/// `JSON.stringify(value, undefined, 4)`.
+fn json_stringify(value: &Value) -> String {
+ let mut text = Vec::new();
+ let mut serializer = serde_json::Serializer::with_formatter(&mut text, serde_json::ser::PrettyFormatter::with_indent(b" "));
+ serde::Serialize::serialize(value, &mut serializer).expect("a JSON value serializes");
+ String::from_utf8(text).expect("serde_json writes UTF-8")
+}
+
/// `doCreateSingleProblemPattern`; `set_defaults` fills file 1, line 2, column 3 and message 0.
-fn parse_pattern(value: &Value, set_defaults: bool) -> Option<Pattern> {
- let regexp = onig::Regex::new(value["regexp"].as_str()?).ok()?;
+fn parse_pattern(value: &Value, set_defaults: bool, messages: &mut Messages) -> Option<Pattern> {
let mut pattern = Pattern {
- regexp: Arc::new(regexp),
+ regexp: regular_expression(value["regexp"].as_str()?, messages)?,
file_kind: value["kind"].as_str().is_some_and(|kind| kind.eq_ignore_ascii_case("file")),
location_kind: value["kind"].as_str().is_some_and(|kind| kind.eq_ignore_ascii_case("location")),
file: None,
@@ -316,22 +444,6 @@ fn parse_pattern(value: &Value, set_defaults: bool) -> Option<Pattern> {
Some(pattern)
}
-/// `createMultiLineProblemPattern`: no defaults; only the last pattern may loop.
-fn parse_patterns(values: &[Value]) -> Option<Vec<Pattern>> {
- let mut patterns = Vec::new();
- for (index, value) in values.iter().enumerate() {
- let mut pattern = parse_pattern(value, false)?;
- if index + 1 < values.len() {
- pattern.loop_ = false;
- }
- patterns.push(pattern);
- }
- if values.len() == 1 {
- return parse_pattern(&values[0], true).map(|pattern| vec![pattern]);
- }
- (!patterns.is_empty()).then_some(patterns)
-}
-
fn parse_file_location(value: &Value) -> (Option<FileLocation>, Option<String>, (Vec<String>, Vec<String>)) {
let kind = |name: &str| match name.to_lowercase().as_str() {
"absolute" => Some(FileLocation::Absolute),
@@ -362,21 +474,32 @@ fn parse_file_location(value: &Value) -> (Option<FileLocation>, Option<String>,
}
/// `addWatchingMatcher`: `background` (or the older `watching`) with both patterns.
-fn parse_watching(description: &Value) -> Option<Watching> {
- let watching_pattern = |value: &Value| -> Option<WatchingPattern> {
- let (regexp, file) = match value {
- Value::String(regexp) => (regexp.as_str(), 1),
- Value::Object(_) => (value["regexp"].as_str()?, value["file"].as_u64().unwrap_or(1) as usize),
- _ => return None,
- };
- Some(WatchingPattern { regexp: Arc::new(onig::Regex::new(regexp).ok()?), file })
+fn parse_watching(description: &Value, messages: &mut Messages) -> Option<Watching> {
+ let mut regexp = |value: &Value| value.as_str().filter(|value| !value.is_empty()).and_then(|value| regular_expression(value, messages));
+ let old_begins = regexp(&description["watchedTaskBeginsRegExp"]);
+ let old_ends = regexp(&description["watchedTaskEndsRegExp"]);
+ if let (Some(begins), Some(ends)) = (old_begins, old_ends) {
+ return Some(Watching { active_on_start: false, begins: WatchingPattern { regexp: begins, file: 1 }, ends: WatchingPattern { regexp: ends, file: 1 } });
+ }
+ let monitor = if is_truthy(&description["background"]) { &description["background"] } else { &description["watching"] };
+ if monitor.is_null() {
+ return None;
+ }
+ let mut watching_pattern = |value: &Value| {
+ let file = value["file"].as_u64().filter(|file| *file != 0).unwrap_or(1) as usize;
+ let regexp = if value.is_string() { regexp(value) } else { regexp(&value["regexp"]) };
+ regexp.map(|regexp| WatchingPattern { regexp, file })
};
- if let (Some(begins), Some(ends)) = (description["watchedTaskBeginsRegExp"].as_str(), description["watchedTaskEndsRegExp"].as_str()) {
- let compile = |regexp: &str| onig::Regex::new(regexp).ok().map(|regexp| WatchingPattern { regexp: Arc::new(regexp), file: 1 });
- return Some(Watching { active_on_start: false, begins: compile(begins)?, ends: compile(ends)? });
+ let begins = watching_pattern(&monitor["beginsPattern"]);
+ let ends = watching_pattern(&monitor["endsPattern"]);
+ match (begins, ends) {
+ (Some(begins), Some(ends)) => Some(Watching { active_on_start: monitor["activeOnStart"] == true, begins, ends }),
+ (None, None) => None,
+ _ => {
+ messages.push((Severity::Error, "A problem matcher must define both a begin pattern and an end pattern for watching.".into()));
+ None
+ }
}
- let monitor = if description["background"].is_object() { &description["background"] } else { &description["watching"] };
- Some(Watching { active_on_start: monitor["activeOnStart"] == true, begins: watching_pattern(&monitor["beginsPattern"])?, ends: watching_pattern(&monitor["endsPattern"])? })
}
/// `Severity.fromValue` with the problem matcher's single letter and hint/note forms.
@@ -630,7 +753,7 @@ mod tests {
#[test]
fn a_tsc_error_becomes_a_marker_of_the_file() {
let contributions = contributions();
- let registry = Registry::new(&[&contributions]);
+ let registry = Registry::new(&[("test.tsc", &contributions)]);
let mut matcher = registry.get("tsc").unwrap().clone();
matcher.file_prefix = Some("/work".into());
let found = run(&matcher, &["src/a.ts(3,5): error TS2322: Type 'x' is not assignable."]);
@@ -644,7 +767,7 @@ mod tests {
#[test]
fn multi_line_patterns_loop_over_the_file_s_problems() {
let registry = Registry::new(&[]);
- let matcher = registry.parse(&json!({ "base": "$eslint-stylish", "owner": "lint" })).unwrap();
+ let matcher = registry.parse(&json!({ "base": "$eslint-stylish", "owner": "lint" }), &mut Messages::new()).unwrap();
let found = run(&matcher, &["/a/b.js", " 1:2 error Missing semicolon semi", " 4:1 warning Unused no-unused"]);
assert_eq!(found.len(), 2);
assert_eq!((found[1].marker["severity"].clone(), found[1].marker["startLineNumber"].clone(), found[1].owner.as_str()), (json!(4), json!(4), "lint"));
@@ -654,10 +777,58 @@ mod tests {
#[test]
fn an_inline_matcher_gets_the_default_groups_and_a_whole_line_range() {
let registry = Registry::new(&[]);
- let matcher = registry.parse(&json!({ "owner": "x", "fileLocation": ["relative", "/root"], "pattern": { "regexp": "^(.*):(\\d+): (.*)$", "message": 3, "column": 9 } })).unwrap();
+ let matcher = registry.parse(&json!({ "owner": "x", "fileLocation": ["relative", "/root"], "pattern": { "regexp": "^(.*):(\\d+): (.*)$", "message": 3, "column": 9 } }), &mut Messages::new()).unwrap();
let found = run(&matcher, &["../c.txt:7: bad"]);
assert_eq!(found[0].resource, PathBuf::from("/c.txt"));
assert_eq!(found[0].marker["endColumn"], json!((1u64 << 31) - 1));
assert_eq!(found[0].marker["message"], "bad");
}
+
+ /// problemMatcher.test.ts ProblemPatternParser cases, and the registries' extension messages.
+ #[test]
+ fn invalid_problem_patterns_and_matchers_are_extension_messages() {
+ let messages_of = |value: Value| {
+ let mut messages = Messages::new();
+ let patterns = parse_problem_pattern(&value, &mut messages);
+ (patterns.map(|patterns| patterns.len()), messages.into_iter().map(|(_, message)| message).collect::<Vec<_>>())
+ };
+ assert_eq!(messages_of(json!([{ "regexp": "test", "file": 3, "loop": true }, { "regexp": "test1", "line": 4 }])).1, [
+ "The loop property is only supported on the last line matcher.",
+ "The problem pattern is invalid. It must have at least have a file and a message.",
+ ]);
+ assert_eq!(messages_of(json!([{ "regexp": "test", "file": 3, "message": 1 }, { "regexp": "test1", "kind": "location", "line": 4 }])), (Some(2), vec!["The problem pattern is invalid. The kind property must be provided only in the first element".into()]));
+ assert_eq!(messages_of(json!([{ "file": 0, "line": 1, "message": 0 }])).1, ["The problem pattern is missing a regular expression."]);
+ assert_eq!(messages_of(json!([{ "regexp": "test", "file": 1, "column": 20, "message": 0 }])).1, ["The problem pattern is invalid. It must either have kind: \"file\" or have a line or location match group."]);
+ assert_eq!(messages_of(json!([{ "regexp": "test", "kind": "file", "file": 2, "message": 6 }])), (Some(1), vec![]));
+ assert_eq!(messages_of(json!([])).1, ["The problem pattern is invalid. It must contain at least one pattern."]);
+ assert_eq!(messages_of(json!({ "regexp": "(" })).1, ["Error: The string ( is not a valid regular expression.\n"]);
+
+ let contributions = json!({
+ "problemPatterns": [
+ { "name": "good", "regexp": "^(.*):(\\d+): (.*)$", "message": 3 },
+ { "name": "bad", "regexp": "(" },
+ { "name": "after-bad", "regexp": "^(.*):(\\d+): (.*)$", "message": 3 },
+ ],
+ "problemMatchers": [
+ { "name": "no-pattern", "owner": "a", "pattern": "$missing" },
+ { "name": "empty-owner", "owner": "", "base": "$go" },
+ { "name": "half-background", "owner": "a", "pattern": "$good", "severity": "fatal", "background": { "beginsPattern": "^start$" } },
+ ],
+ });
+ let registry = Registry::new(&[("test.problem-matchers", &contributions)]);
+ assert!(registry.patterns.contains_key("good") && !registry.patterns.contains_key("after-bad"), "upstream's reporter state stays at Error");
+ assert!(registry.get("half-background").is_some_and(|matcher| matcher.watching.is_none()));
+ let messages: Vec<String> = crate::perf::messages("test.problem-matchers").into_iter().map(|(_, message)| message).collect();
+ assert_eq!(messages, [
+ "Error: The string ( is not a valid regular expression.\n".into(),
+ "Invalid problem pattern. The pattern will be ignored.".into(),
+ "{\n \"name\": \"bad\",\n \"regexp\": \"(\"\n}".into(),
+ "{\n \"name\": \"after-bad\",\n \"regexp\": \"^(.*):(\\\\d+): (.*)$\",\n \"message\": 3\n}".into(),
+ "Error: the pattern with the identifier $missing doesn't exist.".into(),
+ format!("Error: the description can't be converted into a problem matcher:\n{}\n", json_stringify(&contributions["problemMatchers"][0])),
+ format!("Error: the description doesn't define an owner:\n{}\n", json_stringify(&contributions["problemMatchers"][1])),
+ "Info: unknown severity fatal. Valid values are error, warning and info.\n".into(),
+ "A problem matcher must define both a begin pattern and an end pattern for watching.".into(),
+ ]);
+ }
}
diff --git a/native/crates/app/src/workbench/task_service.rs b/native/crates/app/src/workbench/task_service.rs
index 7d25c416e14..b2b675deb84 100644
--- a/native/crates/app/src/workbench/task_service.rs
+++ b/native/crates/app/src/workbench/task_service.rs
@@ -169,8 +169,7 @@ type Fetched = oneshot::Receiver<Vec<Task>>;
impl TaskService {
pub fn new(contributions: &[(&str, &Value)]) -> Self {
- let contributes: Vec<&Value> = contributions.iter().map(|(_, contributes)| *contributes).collect();
- TaskService { definitions: definitions(contributions), matchers: Registry::new(&contributes), ..Default::default() }
+ TaskService { definitions: definitions(contributions), matchers: Registry::new(contributions), ..Default::default() }
}
fn definition(&self, task_type: &str) -> Option<&TaskDefinition> {
@@ -705,7 +704,12 @@ impl Workbench {
for reference in &task.problem_matchers {
let matcher = match reference {
Value::String(name) => self.tasks.matchers.get(name.trim_start_matches('$')).cloned(),
- description => self.tasks.matchers.parse(description),
+ description => {
+ let mut messages = Vec::new();
+ let matcher = self.tasks.matchers.parse(description, &mut messages);
+ messages.iter().for_each(|(_, message)| self.log_task_error(message));
+ matcher
+ }
};
let Some(mut matcher) = matcher else {
self.log_task_error(&format!("Problem matcher {reference} can't be resolved. The matcher will be ignored"));
diff --git a/port/ledger.md b/port/ledger.md
index 501da7d42e9..9fc53722049 100644
--- a/port/ledger.md
+++ b/port/ledger.md
@@ -482,7 +482,7 @@ One row per upstream unit, generated by `bun port/tools/gen-ledger.ts`; mileston
| workbench/contrib/emergencyAlert | workbench contribution | | removed | | no AI or Microsoft services by decision (port/notes.md); API stays inert |
| workbench/contrib/emmet | workbench contribution | M13 | verified | | workbench/emmet.rs: Emmet: Expand Abbreviation (`emmet.expandAbbreviation` with the language at the cursor and the emmet parent mode of its grammar's scope, emmetAction.test.ts cases), Tab with `emmet.triggerExpansionOnTab`, the Edit menu entry: cargo test -p app emmet menubar |
| workbench/contrib/encryption | workbench contribution | M10 | n/a | | encryption.contribution.ts only migrates Linux `password-store` argv values to gnome-libsecret; the port runs on macOS and keeps secrets in the Keychain |
-| workbench/contrib/extensions | workbench contribution | M18 | ported | [3 L] snippet_completions.rs:121: the Runtime Status Messages list the `collector` messages of the snippets, keybindings, languages, statusBarItems, viewsWelcome, debuggers, menus, submenus, commands, views, viewsContainers, configuration, configurationDefaults, jsonValidation, jsonValidationRegistry, colors, icons, semanticTokenTypes, semanticTokenModifiers and semanticTokenScopes points only; those of problemMatchers, problemPatterns, grammars, notebooks and authentication are not ported | Extensions view, queries, details editor, enablement, updates, badge, Help: Start/Continue/Stop Extension Bisect (services/extensionManagement/browser/extensionBisect.ts: state in the application storage across reloads, bisect-disabled extensions as DisabledByEnvironment in the window and out of the host, the urgent sticky prompt, the default-checked Keep this extension disabled; Report Issue & Continue is out with the removed contrib/issue): cargo test -p app extension_bisect, bisect_finds_the_extension_and_keeps_it_disabled; cargo test -p app extension (extensionsViews.test.ts, extensionQuery.test.ts, extensionEnablementService.test.ts cases); Features tab tables and markdown of extensionFeaturesTab.ts and the registered renderers: cargo test -p app extension_features; Runtime Status Uncaught Errors from `$onExtensionRuntimeError` and Messages: cargo test -p app the_runtime_status_lists_uncaught_errors_and_messages, invalid_contributed, static_entries_need_the_proposal, group_needs_the_proposal, debuggers_merge_by_type_and_keep_the_built_in_values, skipped_menu_contributions_are_extension_messages, contributed_command_messages, invalid_views_and_view_containers_are_extension_messages, invalid_configuration_is_an_extension_message, invalid_json_validation_is_an_extension_message, invalid_colors_and_icons_are_extension_messages, invalid_semantic_token_contributions_are_extension_messages; ui-pair port/fixtures/extensions/ui-view.json (view, search, details) against the reference |
+| workbench/contrib/extensions | workbench contribution | M18 | ported | [3 L] snippet_completions.rs:121: the Runtime Status Messages list the `collector` messages of the snippets, keybindings, languages, statusBarItems, viewsWelcome, debuggers, menus, submenus, commands, views, viewsContainers, configuration, configurationDefaults, jsonValidation, jsonValidationRegistry, colors, icons, semanticTokenTypes, semanticTokenModifiers, semanticTokenScopes, problemPatterns and problemMatchers points only; those of grammars, notebooks and authentication are not ported | Extensions view, queries, details editor, enablement, updates, badge, Help: Start/Continue/Stop Extension Bisect (services/extensionManagement/browser/extensionBisect.ts: state in the application storage across reloads, bisect-disabled extensions as DisabledByEnvironment in the window and out of the host, the urgent sticky prompt, the default-checked Keep this extension disabled; Report Issue & Continue is out with the removed contrib/issue): cargo test -p app extension_bisect, bisect_finds_the_extension_and_keeps_it_disabled; cargo test -p app extension (extensionsViews.test.ts, extensionQuery.test.ts, extensionEnablementService.test.ts cases); Features tab tables and markdown of extensionFeaturesTab.ts and the registered renderers: cargo test -p app extension_features; Runtime Status Uncaught Errors from `$onExtensionRuntimeError` and Messages: cargo test -p app the_runtime_status_lists_uncaught_errors_and_messages, invalid_contributed, static_entries_need_the_proposal, group_needs_the_proposal, debuggers_merge_by_type_and_keep_the_built_in_values, skipped_menu_contributions_are_extension_messages, contributed_command_messages, invalid_views_and_view_containers_are_extension_messages, invalid_configuration_is_an_extension_message, invalid_json_validation_is_an_extension_message, invalid_colors_and_icons_are_extension_messages, invalid_semantic_token_contributions_are_extension_messages, invalid_problem_patterns_and_matchers_are_extension_messages; ui-pair port/fixtures/extensions/ui-view.json (view, search, details) against the reference |
| workbench/contrib/externalTerminal | workbench contribution | M15 | verified | | workbench/external_terminal.rs: Open New External Terminal (`workbench.action.terminal.openNativeConsole`, cmd+shift+c), with several workspace folders after the Select workspace folder pick (cargo test -p app open_native_console_picks_a_folder_in_a_multi_root_workspace); cargo test -p app external_terminal; ui-pair (port/results/terminal.md) |
| workbench/contrib/externalUriOpener | workbench contribution | M12 | verified | | workbench/opener.rs: externalUriOpenerService.ts getRequestedOpener (workbench.externalUriOpeners globs), chooseOpener, "How would you like to open: {0}" picker; no Simple Browser (out of scope); verified at port-m12b-verify: cargo test -p app opener 4/4; Simple Browser is out of scope by decision |
| workbench/contrib/files | workbench contribution | M12 | ported | [3 M] Files m12: non-file workspace folders | Cmd+V pastes the files another app copied after explorer.confirmPasteNative (explorerView.ts paste listener, fileActions.ts `pasteFileHandler`: cargo test -p app cmd_v_pastes_the_files_finder_copied); Dragged workspace roots reorder before or after a root by the pointer's half, or to the end, with the list.dropBetweenBackground line (explorerViewer.ts `doHandleRootDrop`: cargo test -p app dragging_a_root_reorders_the_workspace_folders; ui-pair dragShot of a three-root workspace, line over a root and below the rows matches); Compact folders off while optimized for a screen reader (explorerView.ts `isCompressionEnabled`: cargo test -p app compacts_single_child_folders_into_one_row); A workspace root that fails to resolve: the single folder's file item of its own resource, the "!" decoration in `list.invalidItemForeground` with "Unable to resolve workspace folder (...)" (explorerViewer.ts `getChildren`, explorerDecorationsProvider.ts: cargo test -p app a_workspace_root_that_fails_to_resolve_is_decorated_with_its_error; ui-pair of a two-root workspace with a missing folder, row and hover match); a copy soft-reverts the target's dirty model, which shows the copied file (workingCopyFileService.ts `doMoveOrCopy`: cargo test -p app a_copy_onto_a_dirty_model_reverts_it_to_the_copied_file); An unreadable folder expands to no children without an error (fileService.ts `toFileStat`: cargo test -p app an_unreadable_folder_expands_to_no_children); Explorer tree read from disk (explorer.rs): folders first, default excludes, click to expand, click opens a file as preview, double click pins, selection follows the active editor; Seti file icons and compareFileNamesDefault sort; workspace folders as roots, first five expanded (cargo test -p app); new file and folder, rename, delete, copy, cut, paste, drag and drop and undo through the working copy file operations (cargo test -p app explorer_actions, file_actions); "Do not ask me again" as the NSAlert suppression checkbox (dialog.rs); the context menu with the items whose commands the port has (port/results/contextmenu.md); tree view state in workspace storage (cargo test -p app view_state); file nesting with the explorerFileNestingTrie.test.ts cases (cargo test -p app nest); copyFilePath, copyRelativeFilePath and revealFileInOS (cargo test -p app copy_path, copied_path_labels); compact folders (cargo test -p app compact, get_context, compressed_navigation); Explorer find (cargo test -p app explorer_find find_filters); Finder drops through ExternalFileImport (cargo test -p app files_dropped_from_finder); explorer.sortOrder and sortOrderLexicographicOptions; explorer.autoReveal; list keyboard commands; the view title actions on hover or focus, revealInExplorer, showActiveFileInExplorer and the other file actions (cargo test -p app view_title_and_file_actions); workbench.action.files.newFile and showOpenedFileInNewWindow (cargo test -p app new_file_creates); Add Folder to Workspace and removeRootFolder (workbench/workspace_editing.rs, ui-pair port/fixtures/ui-pair/m12/workspace-folders.json); the compare commands compareFiles, selectForCompare, compareSelected, compareFileWith, compareWithSaved, compareWithClipboard, compareNewUntitledTextFiles (workbench/file_compare.rs: cargo test -p app file_compare); compare with saved by its chord: ui-pair port/fixtures/ui-pair/m12/compare-saved.json (the modified side has its own editor and cursor, at the first change: cargo test -p app file_compare; left the breadcrumbs editor type picker); Find in Folder..., Open in Integrated/External Terminal (cargo test -p app explorer_actions; ui-pair m12/find-in-folder.json and m12/folder-terminal.json), high contrast list outline (icons.json hc matches); rename, delete, new file and drag and drop with its move confirmation: ui-pair m12/explorer-ops.json matches; `<view id>.focus` of the Explorer panes (cargo test -p app focus_view_commands); the editor placeholders: binary, too large, not found and read errors with their actions (cargo test -p app files_that_do_not_resolve; ui-pair m12/editor-placeholders.json matches); the Open Editors view: pane size limits, group rows, unsaved badge, title actions, row close and dirty actions, drag to groups (cargo test -p app open_editors body_limits_clamp; ui-pair m12/open-editors.json); pinned (sticky) editors and scrolling tab bars, sticky shrink tabs in place with the `m…` label (cargo test -p app sticky pinned_editors tab_scroll; ui-pair m12/tab-scroll.json); Explorer indent guides at the reference x, row hover background, decoration badges at 11px 8px from the end, the Unpin Editor hover again after the tab menu closes (cargo test -p app tree_guides hover unpin_hover; ui-pair m12/explorer-guides.json and m12/pinned-tabs.json match). Differences left (port/notes.md milestone 12, session m12-files-done): a long tooltip breaks one path segment earlier (GPUI's line wrapper), the pin action loses its hover style after Cmd+W until the pointer moves (gpui keyboard modality), a shrink sticky tab with a badge and no room for its name; Open With... (`explorer.openWith`, `explorerResourceAvailableEditorIds`: cargo test -p app open_with_opens_the_resource the_context_menu_selects_the_row); Compare Active File With... from a file it opens itself: ui-pair m12/compare.json, the picker, the diff and the README.md menu match (port/notes.md session compare-fix); `explorerResourceReadonly` and `explorerResourceParentReadOnly` from `isReadonly` (cargo test -p app readonly_keys_follow_the_focused_item_and_its_parent); a failed create as an error notification with Retry, a dropped folder added to the workspace (cargo test -p app a_failed_create_offers a_folder_dropped_on_the_root) |