Skip to content

feat(classfile): add resource schema reader - #2726

Draft
aofei wants to merge 2 commits into
goplus:mainfrom
aofei:classfile-resource-schema-reader
Draft

feat(classfile): add resource schema reader#2726
aofei wants to merge 2 commits into
goplus:mainfrom
aofei:classfile-resource-schema-reader

Conversation

@aofei

@aofei aofei commented Apr 14, 2026

Copy link
Copy Markdown
Member

Add cl/outline/classfile to load resource schemas declared by typed framework packages.

Collect resource kinds, discovery query fragments, handle-bearing types, and API scope bindings from Go and XGo source.

Make outline loading read Go source expressions reliably and defer generic constraint validation until recursive types are complete. This keeps real framework packages working with Go 1.24 without accepting invalid type arguments.

Updates #2704

@codecov

codecov Bot commented Apr 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.32%. Comparing base (0e2b085) to head (630f287).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2726      +/-   ##
==========================================
+ Coverage   94.27%   94.32%   +0.05%     
==========================================
  Files          32       32              
  Lines       10576    10637      +61     
==========================================
+ Hits         9970    10033      +63     
+ Misses        431      429       -2     
  Partials      175      175              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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.

Comment thread cl/outline/classfile/loader.go Outdated
Comment thread cl/outline/classfile/loader.go Outdated
Comment thread cl/outline/classfile/loader.go Outdated
Comment thread cl/outline/classfile/loader.go Outdated
Comment thread cl/outline/classfile/loader.go Outdated
Comment thread cl/outline/classfile/schema.go
@aofei
aofei force-pushed the classfile-resource-schema-reader branch 7 times, most recently from 4d407c5 to c1db598 Compare April 15, 2026 09:40
@aofei
aofei force-pushed the classfile-resource-schema-reader branch 2 times, most recently from 956dd27 to e352268 Compare July 31, 2026 12:29
Define framework resource kinds, pack-document discovery, typed scope
bindings, and static tool semantics for classfile resources.

Specify active project groups and flat project lowering, including shared
project types, fragment ordering, field initialization, and callback
assembly.

Clarify pack-document merging and DQL query fragments relative to
implicit discovery roots.

Fixes goplus#2704
Updates goplus#2719
Updates goplus#2802

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
@aofei
aofei force-pushed the classfile-resource-schema-reader branch 2 times, most recently from b3c2bf3 to 58c2bf9 Compare August 6, 2026 01:11
Add `cl/outline/classfile` to load resource schemas declared by typed
framework packages.

Collect resource kinds, discovery query fragments, handle-bearing
types, and API scope bindings from Go and XGo source.

Make outline loading read Go source expressions reliably and defer
generic constraint validation until recursive types are complete. This
keeps real framework packages working with Go 1.24 without accepting
invalid type arguments.

Updates goplus#2704

Signed-off-by: Aofei Sheng <aofei@aofeisheng.com>
@aofei
aofei force-pushed the classfile-resource-schema-reader branch from 58c2bf9 to 630f287 Compare August 6, 2026 02:59
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.

1 participant