Remove dry_run and overloads from remaining editing methods

Add corresponding test classes and test cases (not yet working)
This commit is contained in:
Dominik Jain committed 2025-05-29 19:11:43 +02:00
1 parent bed72f417a
commit e9d10fde19
3 files changed
+86 -287

No files matched your search

+2 -14
View File
@@ -24,20 +24,8 @@ class InMemorySerenaConfig(SerenaConfigBase):
if __name__ == "__main__":
project_path = str(Path("test") / "resources" / "repos" / "python" / "test_repo")
agent = SerenaAgent(project=project_path, serena_config=InMemorySerenaConfig())
find_symbol_tool = agent.get_tool(FindSymbolTool)
# apply a tool
find_symbol_tool = agent.get_tool(FindSymbolTool)
print("Finding the symbol 'VariableContainer'\n")
pprint(json.loads(find_symbol_tool.apply("VariableContainer", within_relative_path=str(Path("test_repo") / "variables.py"))))
# modifying with dry-run
symbol_manager = agent.symbol_manager
code_diff = symbol_manager.insert_after_symbol(
"VariableContainer/modify_instance_var",
relative_file_path=str(Path("test_repo") / "variables.py"),
body="test test\nsecond line",
dry_run=True,
)
print(f"Deleted lines: {code_diff.deleted_lines}")
print(f"Added lines: {code_diff.added_lines}")
print(f"Edited module: {code_diff.modified_content}")