mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user