From b25ef84b6e496005da2119b745b9d1be0d568dd5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 28 Sep 2026 15:57:39 +0000 Subject: [PATCH 1/3] Initial plan From 13a76c00f4a543062d08c9f59ca41eeca9b02c48 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 28 Sep 2026 16:02:34 +0000 Subject: [PATCH 2/3] Handle new oxc HTML comment kinds in parser Co-authored-by: marcoroth <6411752+marcoroth@users.noreply.github.com> --- rust/src/parse.rs | 1 + rust/tests/parse_test.rs | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/rust/src/parse.rs b/rust/src/parse.rs index cb20b4b..b5778f6 100644 --- a/rust/src/parse.rs +++ b/rust/src/parse.rs @@ -68,6 +68,7 @@ fn collect_comments(source: &str, program: &oxc::ast::ast::Program<'_>, include_ kind: match comment.kind { CommentKind::Line => "Line", CommentKind::SingleLineBlock | CommentKind::MultiLineBlock => "Block", + CommentKind::HtmlOpen | CommentKind::HtmlClose => "Line", }, value: comment.content_span().source_text(source).to_string(), start: comment.span.start, diff --git a/rust/tests/parse_test.rs b/rust/tests/parse_test.rs index f95b185..d090265 100644 --- a/rust/tests/parse_test.rs +++ b/rust/tests/parse_test.rs @@ -46,6 +46,20 @@ fn parse_leaves_the_ast_out_when_it_was_only_asked_to_read() { ); } +#[test] +fn parse_treats_html_comments_as_line_comments() { + let (code, answer) = parse("\nfoo()", r#"{"ast":false,"source_type":"script"}"#); + + assert_eq!(code, OxcErrorCode::None); + + let payload: serde_json::Value = serde_json::from_str(&answer).unwrap(); + let comments = payload["comments"].as_array().unwrap(); + + assert_eq!(comments.len(), 1); + assert_eq!(comments[0]["type"], "Line"); + assert_eq!(comments[0]["value"], ""); +} + #[test] fn parse_answers_what_it_could_not_read_inside_the_result() { let (code, answer) = parse("const x = ;", r#"{"ast":false}"#);