-
Notifications
You must be signed in to change notification settings - Fork 22
feat(injector/typed): add interface-based type system with parser #633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
RomainMuller
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It really bothers me that it's unclear whether the types are conveyed by pointer or value... They need to be either, not both... The pointer derefs look odd and should be removed one way or the other IMHO.
d2cdd1b to
bbe2ed1
Compare
a081e66 to
65b54f7
Compare
bbe2ed1 to
d575c0b
Compare
23bf3bc to
b30a1ec
Compare
d575c0b to
a59cbdb
Compare
b30a1ec to
e7f3303
Compare
e7f3303 to
0f39ff3
Compare
|
/merge |
|
View all feedbacks in Devflow UI.
This merge request is not mergeable yet, because of pending checks/missing approvals. It will be added to the queue as soon as checks pass and/or get approvals.
[email protected] unqueued this merge request |
|
/remove |
|
View all feedbacks in Devflow UI.
|
ae81016 to
fadb8a4
Compare
0f0aca9 to
7121fd0
Compare
Pull request was converted to draft
7121fd0 to
b9416ed
Compare
There was a problem hiding this 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 comprehensive interface-based type system for the injector/typed package, replacing the previous TypeName struct with a polymorphic Type interface. The changes also include a new recursive descent parser that replaces regex-based parsing for improved performance and Unicode support.
Key changes:
- Replace TypeName struct with Type interface supporting pointer, slice, array, and map types
- Implement recursive descent parser with comprehensive Unicode support
- Rename TypeName to NamedType for clarity and add helper functions
Reviewed Changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/injector/typed/typename_test.go | Removed - replaced by new type-specific test files |
| internal/injector/typed/typename.go | Removed - functionality migrated to new type system files |
| internal/injector/typed/typed.go | New utility functions for type extraction |
| internal/injector/typed/type_test.go | Basic tests for new Type interface |
| internal/injector/typed/type.go | Core Type interface definition with comprehensive documentation |
| internal/injector/typed/slice_test.go | Comprehensive tests for slice type parsing and matching |
| internal/injector/typed/slice.go | SliceType implementation |
| internal/injector/typed/pointer_test.go | Tests for pointer type functionality |
| internal/injector/typed/pointer.go | PointerType implementation |
| internal/injector/typed/parser.go | New recursive descent parser with Unicode support |
| internal/injector/typed/parse_test.go | Extensive parser tests including Unicode handling |
| internal/injector/typed/namedtype_test.go | Tests for NamedType functionality |
| internal/injector/typed/namedtype.go | NamedType implementation with backward compatibility |
| internal/injector/typed/map_test.go | Tests for map type parsing and matching |
| internal/injector/typed/map.go | MapType implementation |
| internal/injector/typed/array_test.go | Tests for array type functionality |
| internal/injector/typed/array.go | ArrayType implementation |
| internal/injector/aspect/join/struct.go | Updated to use new type system |
| internal/injector/aspect/join/function_test.go | Updated type references |
| internal/injector/aspect/join/function.go | Updated to use NamedType pointers |
| internal/injector/aspect/join/declaration.go | Updated type usage |
| internal/injector/aspect/advice/struct.go | Updated to use new type system |
| internal/injector/aspect/advice/code/dot_function.go | Updated type matching calls |
| internal/injector/aspect/advice/call_test.go | Updated type references |
| internal/injector/aspect/advice/call.go | Updated to use new type system |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
d58b189 to
b341ca5
Compare
- Introduce Type interface for polymorphic type handling - Add support for pointer, slice, array, and map types - Implement recursive descent parser for type expressions - Rename TypeName to NamedType for clarity - Add helper functions NewNamedType and MustNamedType - Update all usage sites to use new type system
Signed-off-by: Kemal Akkoyun <[email protected]>
…ration testing Signed-off-by: Kemal Akkoyun <[email protected]>
a150f32 to
5375609
Compare
Signed-off-by: Kemal Akkoyun <[email protected]>
5375609 to
7b77e61
Compare

feat(injector/typed): add interface-based type system with parser
perf(injector/typed): remove regex-based parsing and document improvements
Replaced regex-based type parsing with recursive descent parser:
Benchmark results (old regex vs new parser):
All improvements statistically significant (p=0.008)
Signed-off-by: Kemal Akkoyun [email protected]