MCPcopy Create free account
hub / github.com/HKUDS/OpenSpace / _parse_add_file_content

Function _parse_add_file_content

openspace/skill_engine/patch.py:567–580  ·  view source on GitHub ↗

Collect ``+``-prefixed lines for an Add File hunk.

(
    lines: List[str], start_idx: int,
)

Source from the content-addressed store, hash-verified

565 return None
566
567def _parse_add_file_content(
568 lines: List[str], start_idx: int,
569) -> Tuple[str, int]:
570 """Collect ``+``-prefixed lines for an Add File hunk."""
571 content_lines: List[str] = []
572 i = start_idx
573 while i < len(lines) and not lines[i].startswith("***"):
574 if lines[i].startswith("+"):
575 content_lines.append(lines[i][1:])
576 i += 1
577 content = "\n".join(content_lines)
578 if content.endswith("\n"):
579 content = content[:-1]
580 return content, i
581
582def _parse_update_chunks(
583 lines: List[str], start_idx: int,

Callers 1

parse_patchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected