(fset *token.FileSet, f *ast.File, fs []*ast.File, src []byte)
| 99 | } |
| 100 | |
| 101 | func (p *Parser) parseFunctions(fset *token.FileSet, f *ast.File, fs []*ast.File, src []byte) []*models.Function { |
| 102 | ul, el := p.parseTypes(fset, fs) |
| 103 | // Parse type declarations to extract type parameters |
| 104 | typeParams := p.parseTypeDecls(f, fs) |
| 105 | var funcs []*models.Function |
| 106 | for _, d := range f.Decls { |
| 107 | fDecl, ok := d.(*ast.FuncDecl) |
| 108 | if !ok { |
| 109 | continue |
| 110 | } |
| 111 | fn := parseFunc(fDecl, ul, el, typeParams) |
| 112 | // Extract function body source code for AI context |
| 113 | if fDecl.Body != nil { |
| 114 | fn.Body = extractFunctionBody(fset, fDecl, src) |
| 115 | } |
| 116 | funcs = append(funcs, fn) |
| 117 | } |
| 118 | return funcs |
| 119 | } |
| 120 | |
| 121 | // parseTypeDecls extracts type parameters from type declarations |
| 122 | // Returns a map from type name to its type parameters |
no test coverage detected