Skip to content

fix(codegen): escape doc comments#10086

Merged
dyc3 merged 1 commit into
mainfrom
dyc3/escape-doc-comments
Apr 22, 2026
Merged

fix(codegen): escape doc comments#10086
dyc3 merged 1 commit into
mainfrom
dyc3/escape-doc-comments

Conversation

@dyc3

@dyc3 dyc3 commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

Summary

fixes main branch failures

Test Plan

green ci

Docs

@changeset-bot

changeset-bot Bot commented Apr 22, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 9ea5eff

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions github-actions Bot added A-Project Area: project A-Tooling Area: internal tools labels Apr 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 53183 53183 0
Passed 51963 51963 0
Failed 1178 1178 0
Panics 42 42 0
Coverage 97.71% 97.71% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 38 38 0
Passed 37 37 0
Failed 1 1 0
Panics 0 0 0
Coverage 97.37% 97.37% 0.00%

markdown/commonmark

Test result main count This PR count Difference
Total 652 652 0
Passed 652 652 0
Failed 0 0 0
Panics 0 0 0
Coverage 100.00% 100.00% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 5467 5467 0
Passed 1915 1915 0
Failed 3552 3552 0
Panics 0 0 0
Coverage 35.03% 35.03% 0.00%

ts/babel

Test result main count This PR count Difference
Total 640 640 0
Passed 569 569 0
Failed 71 71 0
Panics 0 0 0
Coverage 88.91% 88.91% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 18876 18876 0
Passed 13014 13014 0
Failed 5861 5861 0
Panics 1 1 0
Coverage 68.94% 68.94% 0.00%

@coderabbitai

coderabbitai Bot commented Apr 22, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 50c53b12-da0b-4359-8ca6-81efefc44820

📥 Commits

Reviewing files that changed from the base of the PR and between 7b12f67 and 9ea5eff.

⛔ Files ignored due to path filters (1)
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
📒 Files selected for processing (2)
  • crates/biome_service/src/workspace_types.rs
  • xtask/codegen/src/generate_bindings.rs

Walkthrough

Adds a new internal helper escape_jsdoc_comment_text(&str) -> String in two locations (crates/biome_service/src/workspace_types.rs and xtask/codegen/src/generate_bindings.rs). The helper replaces */ with *\/. The change applies this escaping when embedding description text into generated JSDoc comments in instance_type(...) and generate_type(...). Unit tests were added to validate escaping for mid-string and trailing */ cases.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarises the main change: escaping doc comments in the codegen process.
Description check ✅ Passed The description relates to the changeset by indicating the PR fixes main branch failures, though it lacks specific technical detail about the escaping mechanism.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dyc3/escape-doc-comments

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
xtask/codegen/src/generate_bindings.rs (1)

16-18: Consider centralising this helper to avoid drift.

Same escape_jsdoc_comment_text exists in crates/biome_service/src/workspace_types.rs (Line 17-Line 19). Tiny duplication today, subtle divergence tomorrow.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@xtask/codegen/src/generate_bindings.rs` around lines 16 - 18, Two identical
helpers named escape_jsdoc_comment_text are duplicated; extract this function
into a single shared utility (e.g., a pub fn escape_jsdoc_comment_text in a
common utils module or crate) and replace the local duplicates with imports that
call the shared function. Specifically, create a single exported function
escape_jsdoc_comment_text in a shared module, remove the duplicates in
generate_bindings.rs and workspace_types.rs, update their use/imports to
reference the shared symbol, and run cargo build to ensure visibility (make it
pub and adjust module paths as needed).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@xtask/codegen/src/generate_bindings.rs`:
- Around line 16-18: Two identical helpers named escape_jsdoc_comment_text are
duplicated; extract this function into a single shared utility (e.g., a pub fn
escape_jsdoc_comment_text in a common utils module or crate) and replace the
local duplicates with imports that call the shared function. Specifically,
create a single exported function escape_jsdoc_comment_text in a shared module,
remove the duplicates in generate_bindings.rs and workspace_types.rs, update
their use/imports to reference the shared symbol, and run cargo build to ensure
visibility (make it pub and adjust module paths as needed).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f3347fff-9f67-4935-8495-6d91fc33ea81

📥 Commits

Reviewing files that changed from the base of the PR and between 98cc11e and 7b12f67.

⛔ Files ignored due to path filters (1)
  • packages/@biomejs/backend-jsonrpc/src/workspace.ts is excluded by !**/backend-jsonrpc/src/workspace.ts and included by **
📒 Files selected for processing (2)
  • crates/biome_service/src/workspace_types.rs
  • xtask/codegen/src/generate_bindings.rs

@dyc3 dyc3 force-pushed the dyc3/escape-doc-comments branch from 7b12f67 to 9ea5eff Compare April 22, 2026 14:53
@dyc3 dyc3 merged commit 38deeae into main Apr 22, 2026
27 checks passed
@dyc3 dyc3 deleted the dyc3/escape-doc-comments branch April 22, 2026 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Project Area: project A-Tooling Area: internal tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant