read_file: inline block comments misclassified

Resolved 💬 1 comment Opened Jan 24, 2026 by AmirTlinov Closed Feb 17, 2026

Summary

read_file comment header detection mishandles inline block comments:

  • let x = 1; /* start does 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

  1. Create a file with:
let x = 1; /* start
 * header line
 */
fn main() {}
  1. Call read_file in indentation mode with include_header=true anchored under fn 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.
  • /* ... */ code is treated as header.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗