Skip to content

fix(formatter): Revert #19399#19433

Merged
graphite-app[bot] merged 1 commit intomainfrom
revert-19399
Feb 16, 2026
Merged

fix(formatter): Revert #19399#19433
graphite-app[bot] merged 1 commit intomainfrom
revert-19399

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Feb 16, 2026

https://github.com/oxc-project/monitor-oxc/actions/runs/22057084633/job/63727963672

Formatter DCR detected this:

export const globalRegistry: $ZodRegistry<GlobalMeta> = /*@__PURE__*/ registry<GlobalMeta>();

becomes

export const globalRegistry: $ZodRegistry<GlobalMeta> = registry<GlobalMeta>();

(BlockComment removed)

So, I'll revert it for now.

Copilot AI review requested due to automatic review settings February 16, 2026 10:03
@leaysgur leaysgur requested a review from Dunqing as a code owner February 16, 2026 10:03
@github-actions github-actions bot added A-formatter Area - Formatter C-bug Category - Bug labels Feb 16, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR reverts changes from #19399 to fix a bug where the formatter incorrectly removes block comments like /*@__PURE__*/ from code. The issue was caused by using f.intern() to check if type arguments would break, which had the side effect of advancing the comment cursor and causing comments to be lost.

Changes:

  • Changed several function parameters from &mut Formatter to &Formatter where only read-only operations are performed
  • Refactored is_complex_type_arguments to use f.comments().has_comment_in_span() instead of f.intern() for checking comments
  • Improved the implementation to more closely approximate Prettier's behavior without side effects

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 16, 2026

Merging this PR will not alter performance

✅ 47 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing revert-19399 (fb6e1d3) with main (f5cdc21)

Open in CodSpeed

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@leaysgur leaysgur added the 0-merge Merge with Graphite Merge Queue label Feb 16, 2026
Copy link
Member Author

leaysgur commented Feb 16, 2026

Merge activity

> https://github.com/oxc-project/monitor-oxc/actions/runs/22057084633/job/63727963672

Formatter DCR detected this:

```ts
export const globalRegistry: $ZodRegistry<GlobalMeta> = /*@__PURE__*/ registry<GlobalMeta>();
```

becomes

```ts
export const globalRegistry: $ZodRegistry<GlobalMeta> = registry<GlobalMeta>();
```

(`BlockComment` removed)

So, I'll revert it for now.
@graphite-app graphite-app bot merged commit 47d6a3e into main Feb 16, 2026
21 checks passed
@graphite-app graphite-app bot deleted the revert-19399 branch February 16, 2026 12:43
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants