-
-
Notifications
You must be signed in to change notification settings - Fork 713
refactor(formatter): improve printing trailing comments #14934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
graphite-app
merged 1 commit into
main
from
10-24-refactor_formatter_improve_printing_trailing_comments
Oct 27, 2025
Merged
refactor(formatter): improve printing trailing comments #14934
graphite-app
merged 1 commit into
main
from
10-24-refactor_formatter_improve_printing_trailing_comments
Oct 27, 2025
Conversation
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
This was referenced Oct 24, 2025
CodSpeed Performance ReportMerging #14934 will not alter performanceComparing Summary
Footnotes
|
This was referenced Oct 25, 2025
Merged
Merge activity
|
Improve to handle more edge cases, so that we can remove a lot of specific handling in #14935
7df4b92 to
68c1f2a
Compare
b43db57 to
7a2b9d1
Compare
Base automatically changed from
10-24-fix_formatter_non-nested_static_member_expressions_will_never_break
to
main
October 27, 2025 09:43
leaysgur
added a commit
that referenced
this pull request
Oct 30, 2025
## [0.9.0] - 2025-10-30 ### 🚀 Features - 8fe7e85 formatter: Support printing Formatter IR (#14855) (Dunqing) ### 🐛 Bug Fixes - a6b6ef8 formatter: Correct calculating layout for `TSNonNullExpression` in `StaticMemberExpression` (#15065) (Dunqing) - 99bd995 formatter: Print parenthesis for sequence expression in `ReturnStatement` and `ExpressionStatement` (#15062) (Dunqing) - f3fb998 formatter: Correct printing comments for `TSAsExpression` (#15061) (Dunqing) - 1e4a018 formatter: Correct checking of the short argument for `CallArguments` (#15055) (Dunqing) - c0dfd9b formatter: Print comments before fat arrow as-is for `ArrowFunctionExpression` (#15050) (Dunqing) - 206b519 formatter: Should hug parameter with `TSMappedType` type annotation (#15049) (Dunqing) - e48c604 formatter: Incorrect formatting of a function with `this` parameter (#15031) (Dunqing) - a9f0c45 formatter: Decorators and class method on the same line shouldn't be broken by a leading comment of the method (#15029) (Dunqing) - 43d74e4 formatter: Handle `<CRLF>` for `SourceText` (#15016) (leaysgur) - 34fab40 formatter: Correct calculating layout for `ChainExpression` in `StaticMemberExpression` (#14986) (Dunqing) - 68dc101 formatter: Should not break when the parent of root of `StaticMemberExpression` is used as the `Argument` of `NewExpression` (#14985) (Dunqing) - 071b739 formatter: Align the short argument handling for UnaryExpression with Prettier (#14984) (Dunqing) - 3940f3a formatter: `BestFitting` doesn't exactly matches the `conditinalGroup` behavior in Prettier (#14983) (Dunqing) - 4a84e44 formatter: Align the logic of printing type parameters, parameters, and return type for functions with Prettier (#14942) (Dunqing) - 68c1f2a formatter: Non-nested static member expressions will never break (#14929) (Dunqing) - 42adc47 formatter: Check whether a type alias is complex when its right hand side never break (#14928) (Dunqing) - e501f13 formatter: Should not add a trailing comma for long curried calls when `trailingComma` is es5 (#14913) (Dunqing) ### 🚜 Refactor - 7d64291 formatter: Simplify printing ClassElement with a semicolon (#15030) (Dunqing) - 5de99c2 formatter: Export unified way to get_parse_options (#15027) (leaysgur) - f6f22e2 formatter: Clean up unneeded implementations for printing comments (#14935) (Dunqing) - 7a2b9d1 formatter: Improve printing trailing comments (#14934) (Dunqing) - ba10caa formatter: Align printing trailing comments with Prettier (#14927) (Dunqing) - 597c9e8 formatter: Remove redundunt public API (#14915) (leaysgur) ### ⚡ Performance - 467b3a1 formatter: Optimize grouping logic for call arguments (#15033) (Dunqing) Co-authored-by: leaysgur <6259812+leaysgur@users.noreply.github.com>
graphite-app bot
pushed a commit
that referenced
this pull request
Oct 30, 2025
## [0.9.0] - 2025-10-30 ### 🚀 Features - 8fe7e85 formatter: Support printing Formatter IR (#14855) (Dunqing) ### 🐛 Bug Fixes - a6b6ef8 formatter: Correct calculating layout for `TSNonNullExpression` in `StaticMemberExpression` (#15065) (Dunqing) - 99bd995 formatter: Print parenthesis for sequence expression in `ReturnStatement` and `ExpressionStatement` (#15062) (Dunqing) - f3fb998 formatter: Correct printing comments for `TSAsExpression` (#15061) (Dunqing) - 1e4a018 formatter: Correct checking of the short argument for `CallArguments` (#15055) (Dunqing) - c0dfd9b formatter: Print comments before fat arrow as-is for `ArrowFunctionExpression` (#15050) (Dunqing) - 206b519 formatter: Should hug parameter with `TSMappedType` type annotation (#15049) (Dunqing) - e48c604 formatter: Incorrect formatting of a function with `this` parameter (#15031) (Dunqing) - a9f0c45 formatter: Decorators and class method on the same line shouldn't be broken by a leading comment of the method (#15029) (Dunqing) - 43d74e4 formatter: Handle `<CRLF>` for `SourceText` (#15016) (leaysgur) - 34fab40 formatter: Correct calculating layout for `ChainExpression` in `StaticMemberExpression` (#14986) (Dunqing) - 68dc101 formatter: Should not break when the parent of root of `StaticMemberExpression` is used as the `Argument` of `NewExpression` (#14985) (Dunqing) - 071b739 formatter: Align the short argument handling for UnaryExpression with Prettier (#14984) (Dunqing) - 3940f3a formatter: `BestFitting` doesn't exactly matches the `conditinalGroup` behavior in Prettier (#14983) (Dunqing) - 4a84e44 formatter: Align the logic of printing type parameters, parameters, and return type for functions with Prettier (#14942) (Dunqing) - 68c1f2a formatter: Non-nested static member expressions will never break (#14929) (Dunqing) - 42adc47 formatter: Check whether a type alias is complex when its right hand side never break (#14928) (Dunqing) - e501f13 formatter: Should not add a trailing comma for long curried calls when `trailingComma` is es5 (#14913) (Dunqing) ### 🚜 Refactor - 7d64291 formatter: Simplify printing ClassElement with a semicolon (#15030) (Dunqing) - 5de99c2 formatter: Export unified way to get_parse_options (#15027) (leaysgur) - f6f22e2 formatter: Clean up unneeded implementations for printing comments (#14935) (Dunqing) - 7a2b9d1 formatter: Improve printing trailing comments (#14934) (Dunqing) - ba10caa formatter: Align printing trailing comments with Prettier (#14927) (Dunqing) - 597c9e8 formatter: Remove redundunt public API (#14915) (leaysgur) ### ⚡ Performance - 467b3a1 formatter: Optimize grouping logic for call arguments (#15033) (Dunqing) ### 💼 Other - aceff66 oxfmt: V0.9.0 (#15088) (Boshen)
graphite-app bot
pushed a commit
that referenced
this pull request
Oct 30, 2025
## [0.9.0] - 2025-10-30 ### 🚀 Features - 8fe7e85 formatter: Support printing Formatter IR (#14855) (Dunqing) ### 🐛 Bug Fixes - a6b6ef8 formatter: Correct calculating layout for `TSNonNullExpression` in `StaticMemberExpression` (#15065) (Dunqing) - 99bd995 formatter: Print parenthesis for sequence expression in `ReturnStatement` and `ExpressionStatement` (#15062) (Dunqing) - f3fb998 formatter: Correct printing comments for `TSAsExpression` (#15061) (Dunqing) - 1e4a018 formatter: Correct checking of the short argument for `CallArguments` (#15055) (Dunqing) - c0dfd9b formatter: Print comments before fat arrow as-is for `ArrowFunctionExpression` (#15050) (Dunqing) - 206b519 formatter: Should hug parameter with `TSMappedType` type annotation (#15049) (Dunqing) - e48c604 formatter: Incorrect formatting of a function with `this` parameter (#15031) (Dunqing) - a9f0c45 formatter: Decorators and class method on the same line shouldn't be broken by a leading comment of the method (#15029) (Dunqing) - 43d74e4 formatter: Handle `<CRLF>` for `SourceText` (#15016) (leaysgur) - 34fab40 formatter: Correct calculating layout for `ChainExpression` in `StaticMemberExpression` (#14986) (Dunqing) - 68dc101 formatter: Should not break when the parent of root of `StaticMemberExpression` is used as the `Argument` of `NewExpression` (#14985) (Dunqing) - 071b739 formatter: Align the short argument handling for UnaryExpression with Prettier (#14984) (Dunqing) - 3940f3a formatter: `BestFitting` doesn't exactly matches the `conditinalGroup` behavior in Prettier (#14983) (Dunqing) - 4a84e44 formatter: Align the logic of printing type parameters, parameters, and return type for functions with Prettier (#14942) (Dunqing) - 68c1f2a formatter: Non-nested static member expressions will never break (#14929) (Dunqing) - 42adc47 formatter: Check whether a type alias is complex when its right hand side never break (#14928) (Dunqing) - e501f13 formatter: Should not add a trailing comma for long curried calls when `trailingComma` is es5 (#14913) (Dunqing) ### 🚜 Refactor - 7d64291 formatter: Simplify printing ClassElement with a semicolon (#15030) (Dunqing) - 5de99c2 formatter: Export unified way to get_parse_options (#15027) (leaysgur) - f6f22e2 formatter: Clean up unneeded implementations for printing comments (#14935) (Dunqing) - 7a2b9d1 formatter: Improve printing trailing comments (#14934) (Dunqing) - ba10caa formatter: Align printing trailing comments with Prettier (#14927) (Dunqing) - 597c9e8 formatter: Remove redundunt public API (#14915) (leaysgur) ### ⚡ Performance - 467b3a1 formatter: Optimize grouping logic for call arguments (#15033) (Dunqing) ### 💼 Other - 6368793 oxfmt: V0.9.0 (#15091) (Boshen) - aceff66 oxfmt: V0.9.0 (#15088) (Boshen)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-ast-tools
Area - AST tools
A-formatter
Area - Formatter
C-cleanup
Category - technical debt or refactoring. Solution not expected to change behavior
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.

Improve to handle more edge cases, so that we can remove a lot of specific handling in #14935