-
Notifications
You must be signed in to change notification settings - Fork 7.5k
core: refine read_file block comment headers #9829
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
base: main
Are you sure you want to change the base?
Conversation
|
Note To use Codex here, create a Codex account and connect to github. |
1 similar comment
|
Note To use Codex here, create a Codex account and connect to github. |
|
@codex review и дай отзыв на русском |
|
Note To use Codex here, create a Codex account and connect to github. |
|
@codex review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f7ca315d19
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| *in_block_comment = !trimmed.contains("*/"); | ||
| return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Treat block-comment closers with code as non-comments
When in_block_comment is already true, the branch at this point unconditionally returns true for the whole line after merely checking whether "*/" appears anywhere. That misclassifies valid lines like " */ int x;" (or "*/ let x = 1;") as pure comment lines even though they contain code after the closer. Because include_header explicitly allows comment lines to bypass the sibling suppression logic, this can incorrectly surface real code as a “header comment” line in indentation mode whenever a block comment closes on the same line as subsequent code.
Useful? React with 👍 / 👎.
Summary
/*as starting block-comment state for following lines without marking the current line as a header/* ... */comments when trailing code is presentTesting
Fixes #9828