Skip to content

[api] Add new api parser #1723#1775

Merged
agnesoft merged 5 commits intomainfrom
1723-api-add-new-api-parser
Apr 25, 2026
Merged

[api] Add new api parser #1723#1775
agnesoft merged 5 commits intomainfrom
1723-api-add-new-api-parser

Conversation

@michaelvlach
Copy link
Copy Markdown
Collaborator

No description provided.

michaelvlach and others added 3 commits April 23, 2026 20:36
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
@michaelvlach michaelvlach linked an issue Apr 23, 2026 that may be closed by this pull request
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
agdb Ready Ready Preview, Comment Apr 23, 2026 7:23pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a new type_def reflection/parsing system (replacing the previous api_def approach) and updates the derive/attribute macros plus downstream crates to use the new model.

Changes:

  • Added a new agdb::type_def module (types + tests) to represent reflected structs/enums/traits/functions/impls and expressions.
  • Replaced the old agdb_derive::api_def macro implementation with a new type_def_parser pipeline (struct/enum/impl/trait/function/expression parsing).
  • Updated agdb and agdb_api code to reference type_def and added new proc-macro attributes (trait_def, fn_def) where needed.

Reviewed changes

Copilot reviewed 49 out of 49 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
agdb_derive/src/type_def_parser/trait_parser.rs New parser to emit Type::Trait definitions from syn::ItemTrait.
agdb_derive/src/type_def_parser/struct_parser.rs New struct parser emitting Type::Struct definitions.
agdb_derive/src/type_def_parser/impl_parser.rs New impl-block parser emitting ImplDefinition metadata.
agdb_derive/src/type_def_parser/generics_parser.rs New generics extraction/rendering + type parsing helpers.
agdb_derive/src/type_def_parser/function_parser.rs New function/signature/trait-fn parsing for reflection.
agdb_derive/src/type_def_parser/expression_parser.rs New expression AST extraction into type_def::Expression.
agdb_derive/src/type_def_parser/enum_parser.rs New enum parser emitting Type::Enum definitions.
agdb_derive/src/type_def_parser.rs New module wiring + macro entrypoints for type/impl/trait/fn parsing.
agdb_derive/src/lib.rs Switches proc-macro exports to type_def_parser and adds trait_def/fn_def.
agdb_derive/src/api_def/type_def.rs Removes legacy api_def type parsing implementation.
agdb_derive/src/api_def/tuple_def.rs Removes legacy tuple parsing implementation.
agdb_derive/src/api_def/struct_def.rs Removes legacy struct parsing implementation.
agdb_derive/src/api_def/statement.rs Removes legacy statement parsing implementation.
agdb_derive/src/api_def/generics.rs Removes legacy generics parsing implementation.
agdb_derive/src/api_def/function_def.rs Removes legacy function parsing implementation.
agdb_derive/src/api_def/expression_parser.rs Adds/updates expression parser under api_def directory (legacy path).
agdb_derive/src/api_def/expression/pattern.rs Removes legacy pattern parsing module.
agdb_derive/src/api_def/expression/path.rs Removes legacy path parsing module.
agdb_derive/src/api_def/expression/op.rs Removes legacy operator parsing module.
agdb_derive/src/api_def/expression/object.rs Removes legacy object/struct parsing module.
agdb_derive/src/api_def/expression/macros.rs Removes legacy macro parsing module.
agdb_derive/src/api_def/expression/loops.rs Removes legacy loop parsing module.
agdb_derive/src/api_def/expression/literal.rs Removes legacy literal parsing module.
agdb_derive/src/api_def/expression/conditionals.rs Removes legacy conditional parsing module.
agdb_derive/src/api_def/expression/closure.rs Removes legacy closure parsing module.
agdb_derive/src/api_def/expression/call.rs Removes legacy call parsing module.
agdb_derive/src/api_def/expression/block.rs Removes legacy block parsing module.
agdb_derive/src/api_def/expression/array.rs Removes legacy array parsing module.
agdb_derive/src/api_def/expression.rs Removes legacy expression module facade.
agdb_derive/src/api_def/enum_def.rs Removes legacy enum parsing implementation.
agdb_derive/src/api_def.rs Reworks legacy module to mirror the new parser structure (module-level refactor).
agdb_api/rust/src/http_client.rs Updates API client traits/types to use type_def and new macros.
agdb_api/rust/src/client.rs Updates AgdbApiClient reflection trait bounds + adds trait_def attribute under api feature.
agdb/src/type_def/trait_def.rs Adds type_def::Trait representation + tests.
agdb/src/type_def/struct_def.rs Adds type_def::Struct representation + tests.
agdb/src/type_def/impl_def.rs Adds type_def::Impl representation + tests.
agdb/src/type_def/function_def.rs Adds type_def::Function representation + tests.
agdb/src/type_def/enum_def.rs Adds type_def::Enum representation + tests.
agdb/src/type_def.rs Adds type_def public module (types, traits, literals, pointers, etc.).
agdb/src/query_builder/search.rs Updates reflection trait bounds to type_def + adds trait_def attribute under api feature.
agdb/src/lib.rs Renames api_def module export to type_def and re-exports new proc-macro attributes.
agdb/src/api_def/tuple_def.rs Removes legacy runtime api_def tuple type.
agdb/src/api_def/struct_def.rs Removes legacy runtime api_def struct type.
agdb/src/api_def/function_def.rs Removes legacy runtime api_def function type.
agdb/src/api_def/expression_def.rs Removes legacy runtime api_def expression AST.
agdb/src/api_def/enum_def.rs Removes legacy runtime api_def enum type.
agdb/src/api_def.rs Removes legacy api_def module entrypoint/types.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread agdb_api/rust/src/http_client.rs Outdated
michaelvlach and others added 2 commits April 23, 2026 21:13
Co-authored-by: Copilot <copilot@github.com>
@agnesoft agnesoft merged commit 8dbc58e into main Apr 25, 2026
11 checks passed
@agnesoft agnesoft deleted the 1723-api-add-new-api-parser branch April 25, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[api] Add new api parser

3 participants