test(mcp): Add tests for C/C++ skeleton and outline tools
This commit is contained in:
+8
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user