feat(controller): Integrate py_get_definition for on-demand lookup

This commit is contained in:
2026-03-07 15:03:03 -05:00
parent 953e9e040c
commit c6f9dc886f
4 changed files with 62 additions and 24 deletions

View File

@@ -46,6 +46,13 @@ def parse_symbols(text: str) -> list[str]:
"""
return re.findall(r"@([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)", text)
def get_symbol_definition(symbol: str, files: list[str]) -> tuple[str, str] | None:
for file_path in files:
result = mcp_client.py_get_definition(file_path, symbol)
if 'not found' not in result.lower():
return (file_path, result)
return None
class GenerateRequest(BaseModel):
prompt: str
auto_add_history: bool = True