kcl-lang / kpm

KCL Package Manager
https://kcl-lang.io
Apache License 2.0
27 stars 44 forks source link

Feat: add an API to return a specific schema inheritance chain #398

Open SparkYuan opened 3 months ago

SparkYuan commented 3 months ago

Feature Request

Is your feature request related to a problem? Please describe:

No Describe the feature you'd like:

Add an API to return a specific schema inheritance chain, such as func inheritanceChain(t string) []string

Schema A inherited schema B and B inherited C. The return of inheritanceChain(A) should be [C,B,A]

Peefy commented 3 months ago

Hello @SparkYuan

You can use the API https://github.com/kcl-lang/kpm/blob/c3823c26f4860a50239b9c09bd714f79eaaa0587/pkg/api/kpm_pkg.go#L135 with the KclPackage at the stack.