mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-14 14:17:49 +00:00
Add method execute_task for synchronous execution and apply it in demo script
This commit is contained in:
1 parent
e1d664b25d
commit
2b68790bce
2 files changed
+16
-2
No files matched your search
@@ -20,10 +20,10 @@ class InMemorySerenaConfig(SerenaConfigBase):
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
# project_path = str(Path("test") / "resources" / "repos" / "python" / "test_repo")
|
||||
agent = SerenaAgent(project=REPO_ROOT)
|
||||
|
||||
# apply a tool
|
||||
find_refs_tool = agent.get_tool(FindReferencingSymbolsTool)
|
||||
print("Finding the symbol 'SyncLanguageServer'\n")
|
||||
pprint(json.loads(find_refs_tool.apply(name_path="SyncLanguageServer", relative_path="src/multilspy/language_server.py")))
|
||||
result = agent.execute_task(lambda: find_refs_tool.apply(name_path="SolidLanguageServer", relative_path="src/solidlsp/ls.py"))
|
||||
pprint(json.loads(result))
|
||||
Reference in new issue
Block a user