refactor: streamline agent turn handling and background review process

This commit is contained in:
asepharyana
2026-07-20 17:25:23 +07:00
parent 4c186b62d4
commit dd7825b481
14 changed files with 409 additions and 327 deletions
@@ -468,18 +468,13 @@ fn extract_doc_comments(lines: &[&str]) -> HashMap<usize, String> {
/// Find the next line that looks like a declaration (not doc, not attr).
fn find_next_declaration_line(lines: &[&str], start: usize) -> Option<usize> {
for i in start..lines.len() {
let trimmed = lines[i].trim();
if trimmed.is_empty()
|| trimmed.starts_with("///")
|| trimmed.starts_with("//!")
|| trimmed.starts_with('#')
{
continue;
}
return Some(i);
}
None
lines[start..].iter().position(|line| {
let trimmed = line.trim();
!trimmed.is_empty()
&& !trimmed.starts_with("///")
&& !trimmed.starts_with("//!")
&& !trimmed.starts_with('#')
}).map(|pos| start + pos)
}
// ---------------------------------------------------------------------------