feat(ipuaro): add function signatures to initial context

- Add full function signatures with parameter types and return types
- Arrow functions now extract returnType in ASTParser
- New formatFunctionSignature() helper in prompts.ts
- Add includeSignatures config option (default: true)
- Support compact format when includeSignatures: false
- 15 new tests, coverage 91.14% branches
This commit is contained in:
imfozilbek
2025-12-04 22:29:02 +05:00
parent 7d7c99fe4d
commit 2dcb22812c
7 changed files with 582 additions and 22 deletions

View File

@@ -332,6 +332,7 @@ export class ASTParser {
) {
const params = this.extractParameters(valueNode)
const isAsync = valueNode.children.some((c) => c.type === NodeType.ASYNC)
const returnTypeNode = valueNode.childForFieldName(FieldName.RETURN_TYPE)
ast.functions.push({
name: nameNode?.text ?? "",
@@ -340,6 +341,7 @@ export class ASTParser {
params,
isAsync,
isExported,
returnType: returnTypeNode?.text?.replace(/^:\s*/, ""),
})
if (isExported) {