test(mcp): Add tests for C/C++ skeleton and outline tools

This commit is contained in:
2026-05-05 19:07:17 -04:00
parent 6490be7616
commit 3bb850aca9
4 changed files with 232 additions and 2 deletions
+8 -2
View File
@@ -117,15 +117,21 @@ class ASTParser:
if child.type != "comment":
first_stmt = child
break
initializer = None
for child in node.children:
if child.type == "field_initializer_list":
initializer = child
break
if first_stmt and is_docstring(first_stmt):
start_byte = first_stmt.end_byte
end_byte = body.end_byte
if end_byte > start_byte:
edits.append((start_byte, end_byte, f"\n{indent}..."))
else:
start_byte = body.start_byte
start_byte = initializer.start_byte if initializer else body.start_byte
end_byte = body.end_byte
edits.append((start_byte, end_byte, "..."))
repl = "..."
edits.append((start_byte, end_byte, repl))
for child in node.children:
walk(child)
walk(tree.root_node)