refactor(formatter, codegen): use Comment::newlines to checking if there is a newline around#16482
Merged
graphite-app[bot] merged 1 commit intomainfrom Dec 4, 2025
Conversation
This was referenced Dec 4, 2025
Merged
Member
Author
CodSpeed Performance ReportMerging #16482 will not alter performanceComparing Summary
Footnotes
|
225e486 to
766fd91
Compare
Comment::newlines to checking if there is a newline around
leaysgur
approved these changes
Dec 4, 2025
Member
Merge activity
|
…there is a newline around (#16482) `Comment::preceded_by_newline` is the same as `is_own_line_comment` `Comment::followed_by_newline` is the same as `is_end_of_line_comment` This PR removes `is_own_line_comment` and `is_end_of_line_comment` methods, and changes usages to use `Comment::preceded_by_newline` and `Comment::followed_by_newline` to eliminate extra line break checking.
8c93b42 to
f3fa778
Compare
766fd91 to
6df40ec
Compare
Base automatically changed from
12-04-refactor_formatter_remove_format_only_if_breaks_and_formatonlyifbreaks
to
main
December 4, 2025 07:42
taearls
pushed a commit
to taearls/oxc
that referenced
this pull request
Dec 11, 2025
…there is a newline around (oxc-project#16482) `Comment::preceded_by_newline` is the same as `is_own_line_comment` `Comment::followed_by_newline` is the same as `is_end_of_line_comment` This PR removes `is_own_line_comment` and `is_end_of_line_comment` methods, and changes usages to use `Comment::preceded_by_newline` and `Comment::followed_by_newline` to eliminate extra line break checking.
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.

Comment::preceded_by_newlineis the same asis_own_line_commentComment::followed_by_newlineis the same asis_end_of_line_commentThis PR removes
is_own_line_commentandis_end_of_line_commentmethods, and changes usages to useComment::preceded_by_newlineandComment::followed_by_newlineto eliminate extra line break checking.