Skip to content

Commit

Permalink
schema: Document AttributeAddrSchema & BlockAddrSchema better
Browse files Browse the repository at this point in the history
  • Loading branch information
radeksimko committed Jan 25, 2023
1 parent ca87255 commit 76f1570
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion schema/attribute_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,20 @@ type AttributeSchema struct {
}

type AttributeAddrSchema struct {
// Steps describes address steps used to describe the attribute as whole.
// The last step would typically be AttrNameStep{}.
Steps Address

// FriendlyName is (optional) human-readable name of the *outermost*
// expression interpreted as reference target.
//
// The name is used in completion item and in hover data.
FriendlyName string
ScopeId lang.ScopeId

// ScopeId defines scope of a reference to allow for more granular
// filtering in completion and accurate matching, which is especially
// important for type-less reference targets (i.e. AsReference: true).
ScopeId lang.ScopeId

// AsExprType defines whether the value of the attribute
// is addressable as a matching literal type constraint included
Expand Down
12 changes: 11 additions & 1 deletion schema/block_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,20 @@ type BlockSchema struct {
}

type BlockAddrSchema struct {
// Steps describes address steps used to describe the attribute as whole.
// The last step would typically be LabelStep{}.
Steps Address

// FriendlyName is (optional) human-readable name of the block as whole
// interpreted as reference target.
//
// The name is used in completion item and in hover data.
FriendlyName string
ScopeId lang.ScopeId

// ScopeId defines scope of a reference to allow for more granular
// filtering in completion and accurate matching, which is especially
// important for type-less reference targets (i.e. AsReference: true).
ScopeId lang.ScopeId

// AsReference defines whether the block itself
// is addressable as a type-less reference
Expand Down

0 comments on commit 76f1570

Please sign in to comment.