codex
codex copied to clipboard
read_file: inline block comments misclassified
Summary
read_file comment header detection mishandles inline block comments:
let x = 1; /* startdoes not enter block-comment state, so following* ...lines are not treated as header comments./* comment */ let x = 1;is treated as a header comment even though it has trailing code.
Repro
- Create a file with:
let x = 1; /* start
* header line
*/
fn main() {}
- Call
read_filein indentation mode withinclude_header=trueanchored underfn main().
Expected
- Inline
/*starts block-comment state for subsequent lines, but the line itself is not a header. - Single-line
/* ... */with trailing code is not a header comment.
Actual
- Inline
/*does not start block-comment state, so header lines are missed. /* ... */ codeis treated as header.
Have you actually hit this issue in practice, or is this just based on a TODO comment that you found in the code? We don't want to spend time on theoretical issues when there are many real issues that users are hitting.