feat(classfile): add resource schema reader#2726
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2726 +/- ##
==========================================
- Coverage 94.08% 93.97% -0.11%
==========================================
Files 32 32
Lines 10061 10081 +20
==========================================
+ Hits 9466 9474 +8
- Misses 425 435 +10
- Partials 170 172 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Code Review
This pull request introduces a resource schema loading system for XGo classfiles, enabling the discovery and validation of resource kinds and API scope bindings through source-level directives. It includes the implementation of a schema loader, comprehensive tests, and a new specification document. The review feedback focuses on enhancing diagnostic quality by tracking the source positions of resource declarations, which would allow for more precise error messages when encountering duplicate types or undeclared parent kinds.
b004cfb to
d09a2d1
Compare
Add `doc/classfile-resource-spec.md` to define the resource model for XGo classfile frameworks. The specification now defines discovery-based resource introduction over project-scoped pack documents, work classfile-implied top-level resources, and static tool semantics for typed resource references. This also updates `doc/classfile-spec.md` to define `pack` directives, pack roots, and pack documents as the standardized discovery substrate for classfile resource semantics. Fixes goplus#2704 Updates goplus#2719 Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
6d240a9 to
4d407c5
Compare
Add `cl/outline/classfile` to load resource schema from one typed framework package. This reader collects resource kinds, discovery directives, name-discovery directives, handle-bearing types, and `resource-api-scope-binding` directives from Go and XGo source. Also fix `outline.NewPackage` to load Go-file constant expressions when reading package outlines. This makes the schema reader work on real Go framework packages such as spx, not just on synthetic test packages. Updates goplus#2704 Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
4d407c5 to
c1db598
Compare
Add
cl/outline/classfileto load resource schema from one typed framework package.This reader collects resource kinds, discovery directives, name-discovery directives, handle-bearing types, and
resource-api-scope-bindingdirectives from Go and XGo source.Also fix
outline.NewPackageto load Go-file constant expressions when reading package outlines. This makes the schema reader work on real Go framework packages such as spx, not just on synthetic test packages.Updates #2704