Skip to content

Skip block comment containing a comma between call arguments#21

Merged
electrum merged 1 commit into
airlift:mainfrom
ksobolew:kudi/comma-in-comment
Jun 10, 2026
Merged

Skip block comment containing a comma between call arguments#21
electrum merged 1 commit into
airlift:mainfrom
ksobolew:kudi/comma-in-comment

Conversation

@ksobolew

Copy link
Copy Markdown
Contributor

The scanner explicitly looks for commas, but gets confused when the comma is not part of Java syntax - or, in other words, is in a comment.

@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@electrum, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 50 minutes and 23 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d5b15ec2-1cb4-429c-a735-de58eab2c2b1

📥 Commits

Reviewing files that changed from the base of the PR and between 615786f and 7e8cf21.

📒 Files selected for processing (2)
  • airstyle-core/src/main/java/io/airlift/airstyle/engine/java/JavaExpressionBuilder.java
  • airstyle-core/src/test/java/io/airlift/airstyle/TestCommentPreservationFormatting.java
📝 Walkthrough

Walkthrough

The forward scan in JavaExpressionBuilder.buildCallExpression that extends an argument's end to the next argument now detects and skips both line (//) and block (/* */) comments using tokensIn, advancing the scan index past entire comment tokens so commas inside comments are ignored when locating the real separating comma. Three new JUnit tests assert canonical formatting is preserved for inline block, Javadoc, and line comments that contain commas between wrapped arguments.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
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.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

Copilot AI left a comment

Copy link
Copy Markdown

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 addresses a Java formatter/scanner edge case where the argument-separator comma scan can be thrown off by commas that appear inside comments between call arguments.

Changes:

  • Added a regression test covering an inline block comment containing a comma between invocation arguments.
  • Updated JavaExpressionBuilder to skip over block comments when scanning for the comma that separates adjacent arguments.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
airstyle-core/src/test/java/io/airlift/airstyle/TestCommentPreservationFormatting.java Adds a regression test for inline block comments containing commas between arguments.
airstyle-core/src/main/java/io/airlift/airstyle/engine/java/JavaExpressionBuilder.java Adjusts the comma-detection scan between arguments to ignore commas inside block comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

The scanner explicitly looks for commas, but gets confused when the
comma is not part of Java syntax - or, in other words, is in a comment.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@electrum electrum merged commit f791bc5 into airlift:main Jun 10, 2026
1 check passed
@ksobolew ksobolew deleted the kudi/comma-in-comment branch June 15, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants