Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var EmptyConfigErr = &emptyCfgErr{}
Functions ¶
func ParserSupportsTerraform ¶
Types ¶
type Attribute ¶
type Attribute struct {
// contains filtered or unexported fields
}
func (*Attribute) IsComputedOnly ¶
func (*Attribute) IsDeclared ¶
func (*Attribute) Schema ¶
func (a *Attribute) Schema() *tfjson.SchemaAttribute
type Block ¶
type Block interface {
BlockAtPos(pos hcl.Pos) (Block, bool)
LabelAtPos(pos hcl.Pos) (*Label, bool)
Range() hcl.Range
PosInLabels(pos hcl.Pos) bool
PosInBody(pos hcl.Pos) bool
PosInAttribute(pos hcl.Pos) bool
Attributes() map[string]*Attribute
BlockTypes() map[string]*BlockType
}
Block represents a decoded HCL block (by a Parser) which keeps track of the related schema
func ParseBlock ¶
ParseBlock parses HCL configuration based on tfjson's SchemaBlock and keeps hold of all tfjson schema details on block or attribute level
type BlockType ¶
type BlockType struct {
BlockList []Block
// contains filtered or unexported fields
}
func (*BlockType) ReachedMaxItems ¶
func (*BlockType) Schema ¶
func (b *BlockType) Schema() *tfjson.SchemaBlockType
type BlockTypes ¶
func (BlockTypes) AddBlock ¶
func (bt BlockTypes) AddBlock(name string, block *hclsyntax.Block, typeSchema *tfjson.SchemaBlockType)
type CompletionCandidate ¶ added in v0.2.0
type CompletionCandidate interface {
Label() string
Detail() string
Snippet(pos hcl.Pos) (hcl.Pos, string)
}
CompletionCandidate represents a candidate for completion loosely reflecting lsp.CompletionItem
type CompletionCandidates ¶ added in v0.2.0
type CompletionCandidates interface {
List() []CompletionCandidate
IsComplete() bool
}
CompletionCandidate represents a list of candidates for completion loosely reflecting lsp.CompletionList
type ConfigBlock ¶
type ConfigBlock interface {
CompletionCandidatesAtPos(pos hcl.Pos) (CompletionCandidates, error)
Name() string
BlockType() string
Labels() []*Label
}
ConfigBlock implements an abstraction above HCL block which provides any LSP capabilities (e.g. completion)
type LabelSchema ¶ added in v0.2.0
type LabelSchema []string
type Parser ¶
type Parser interface {
SetLogger(*log.Logger)
SetSchemaReader(schema.Reader)
ParseBlockFromHCL(*hcl.Block) (ConfigBlock, error)
}
Parser implements a parser which can turn raw HCL block into ConfigBlock with the help of a schema reader
func FindCompatibleParser ¶
FindCompatibleParser finds a parser that is compatible with given Terraform version, so that it parses config accuretly