Skip to content

Conversation

@AmirTlinov
Copy link

Summary

  • treat inline /* as starting block-comment state for following lines without marking the current line as a header
  • ignore single-line /* ... */ comments when trailing code is present
  • add unit tests covering both cases

Testing

  • just fmt
  • cargo test -p codex-core

Fixes #9828

@chatgpt-codex-connector
Copy link
Contributor

1 similar comment
@chatgpt-codex-connector
Copy link
Contributor

@AmirTlinov
Copy link
Author

@codex review и дай отзыв на русском

@chatgpt-codex-connector
Copy link
Contributor

@etraut-openai
Copy link
Collaborator

@codex review

Copy link
Contributor

@chatgpt-codex-connector chatgpt-codex-connector bot left a 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".

Comment on lines +437 to +438
*in_block_comment = !trimmed.contains("*/");
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

read_file: inline block comments misclassified

2 participants