Kindsys: Replace "Declaration" with "Definition" (#62515)

* s/Declaration/Definition/g

* s/DeclForGen/DefForGen/g

* Rename some local vars
This commit is contained in:
sam boyer
2023-01-31 04:50:08 -05:00
committed by GitHub
parent d48a8fd227
commit dbe2f0c8f6
34 changed files with 262 additions and 261 deletions

View File

@@ -13,7 +13,7 @@ type PluginDecl struct {
Imports []*ast.ImportSpec
PluginPath string
PluginMeta plugindef.PluginDef
KindDecl kindsys.Decl[kindsys.ComposableProperties]
KindDecl kindsys.Def[kindsys.ComposableProperties]
}
func EmptyPluginDecl(path string, meta plugindef.PluginDef) *PluginDecl {

View File

@@ -61,7 +61,7 @@ func (psr *declParser) Parse(root fs.FS) ([]*PluginDecl, error) {
Imports: pp.CUEImports,
PluginMeta: pp.Properties,
PluginPath: path,
KindDecl: kind.Decl(),
KindDecl: kind.Def(),
})
}
}

View File

@@ -220,7 +220,7 @@ func ParsePluginFS(fsys fs.FS, rt *thema.Runtime) (ParsedPlugin, error) {
return ParsedPlugin{}, err
}
compo, err := kindsys.BindComposable(rt, kindsys.Decl[kindsys.ComposableProperties]{
compo, err := kindsys.BindComposable(rt, kindsys.Def[kindsys.ComposableProperties]{
Properties: props,
V: iv,
})

View File

@@ -36,13 +36,13 @@ type ParsedPlugin struct {
// ComposableKinds represents all the possible composable kinds that may be
// defined in a Grafana plugin.
//
// The value of each field, if non-nil, is a standard [kindsys.Decl]
// The value of each field, if non-nil, is a standard [kindsys.Def]
// representing a CUE definition of a composable kind that implements the
// schema interface corresponding to the field's name. (This invariant is
// only enforced in [ComposableKinds] returned from [ParsePluginFS].)
//
// type ComposableKinds struct {
// PanelCfg kindsys.Decl[kindsys.ComposableProperties]
// Queries kindsys.Decl[kindsys.ComposableProperties]
// DSCfg kindsys.Decl[kindsys.ComposableProperties]
// PanelCfg kindsys.Def[kindsys.ComposableProperties]
// Queries kindsys.Def[kindsys.ComposableProperties]
// DSCfg kindsys.Def[kindsys.ComposableProperties]
// }