fix(formatter): Revert #19399#19433
Merged
graphite-app[bot] merged 1 commit intomainfrom Feb 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
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 Formatterto&Formatterwhere only read-only operations are performed - Refactored
is_complex_type_argumentsto usef.comments().has_comment_in_span()instead off.intern()for checking comments - Improved the implementation to more closely approximate Prettier's behavior without side effects
Merging this PR will not alter performance
Comparing Footnotes
|
Member
Author
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.
fb6e1d3 to
47d6a3e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Formatter DCR detected this:
becomes
(
BlockCommentremoved)So, I'll revert it for now.