Documentation
¶
Index ¶
- func FilenameFromContext(ctx context.Context) (string, bool)
- func MaxCandidatesFromContext(ctx context.Context) (uint, bool)
- func PathFromContext(ctx context.Context) (lang.Path, bool)
- func PosFromContext(ctx context.Context) (hcl.Pos, bool)
- func WithFilename(ctx context.Context, filename string) context.Context
- func WithMaxCandidates(ctx context.Context, maxCandidates uint) context.Context
- func WithPath(ctx context.Context, path lang.Path) context.Context
- func WithPos(ctx context.Context, pos hcl.Pos) context.Context
- type Any
- func (a Any) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (a Any) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (a Any) InferType() (cty.Type, bool)
- func (a Any) ReferenceOrigins(ctx context.Context) reference.Origins
- func (a Any) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
- func (a Any) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type AttributeSymbol
- type BlockSymbol
- type CanInferTypeExpression
- type Candidate
- type CompletionFunc
- type CompletionFuncMap
- type CompletionResolveFunc
- type CompletionResolveFuncMap
- type ConstraintMismatch
- type Decoder
- func (d *Decoder) CodeLensesForFile(ctx context.Context, path lang.Path, file string) ([]lang.CodeLens, error)
- func (d *Decoder) Path(path lang.Path) (*PathDecoder, error)
- func (d *Decoder) ReferenceOriginsTargetingPos(path lang.Path, file string, pos hcl.Pos) ReferenceOrigins
- func (d *Decoder) ReferenceTargetsForOriginAtPos(path lang.Path, file string, pos hcl.Pos) (ReferenceTargets, error)
- func (d *Decoder) ResolveCandidate(ctx context.Context, unresolvedCandidate UnresolvedCandidate) (*ResolvedCandidate, error)
- func (d *Decoder) SetContext(ctx DecoderContext)
- func (d *Decoder) Symbols(ctx context.Context, query string) ([]Symbol, error)
- type DecoderContext
- type ExprSymbol
- type Expression
- type ExpressionCandidate
- type FileNotFoundError
- type Keyword
- type List
- func (list List) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (list List) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (list List) ReferenceOrigins(ctx context.Context) reference.Origins
- func (list List) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
- func (list List) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type LiteralType
- func (lt LiteralType) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (lt LiteralType) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (lt LiteralType) InferType() (cty.Type, bool)
- func (lt LiteralType) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
- func (lt LiteralType) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type LiteralValue
- type Map
- func (m Map) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (m Map) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (m Map) ReferenceOrigins(ctx context.Context) reference.Origins
- func (m Map) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
- func (m Map) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type NoSchemaError
- type Object
- func (obj Object) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (obj Object) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (obj Object) ReferenceOrigins(ctx context.Context) reference.Origins
- func (obj Object) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
- func (obj Object) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type OneOf
- func (oo OneOf) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (oo OneOf) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (oo OneOf) InferType() (cty.Type, bool)
- func (oo OneOf) ReferenceOrigins(ctx context.Context) reference.Origins
- func (oo OneOf) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
- func (oo OneOf) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type PathContext
- type PathDecoder
- func (d *PathDecoder) CollectReferenceOrigins() (reference.Origins, error)
- func (d *PathDecoder) CollectReferenceTargets() (reference.Targets, error)
- func (d *PathDecoder) CollectWriteOnlyAttributes() (WriteOnlyAttributes, error)
- func (d *PathDecoder) CompletionAtPos(ctx context.Context, filename string, pos hcl.Pos) (lang.Candidates, error)
- func (d *PathDecoder) HoverAtPos(ctx context.Context, filename string, pos hcl.Pos) (*lang.HoverData, error)
- func (d *PathDecoder) LinksInFile(filename string) ([]lang.Link, error)
- func (d *PathDecoder) SemanticTokensInFile(ctx context.Context, filename string) ([]lang.SemanticToken, error)
- func (d *PathDecoder) SignatureAtPos(filename string, pos hcl.Pos) (*lang.FunctionSignature, error)
- func (d *PathDecoder) SymbolsInFile(filename string) ([]Symbol, error)
- func (d *PathDecoder) Validate(ctx context.Context) (lang.DiagnosticsMap, error)
- func (d *PathDecoder) ValidateFile(ctx context.Context, filename string) (hcl.Diagnostics, error)
- type PathReader
- type PosOutOfRangeError
- type PositionalError
- type Reference
- func (ref Reference) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (ref Reference) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (ref Reference) ReferenceOrigins(ctx context.Context) reference.Origins
- func (ref Reference) ReferenceTargets(ctx context.Context, _ *TargetContext) reference.Targets
- func (ref Reference) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type ReferenceOrigin
- type ReferenceOrigins
- type ReferenceOriginsExpression
- type ReferenceTarget
- type ReferenceTargets
- type ReferenceTargetsExpression
- type ResolvedCandidate
- type Set
- func (set Set) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (set Set) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (set Set) ReferenceOrigins(ctx context.Context) reference.Origins
- func (set Set) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
- func (set Set) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type Symbol
- type TargetContext
- type Tuple
- func (tuple Tuple) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
- func (tuple Tuple) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
- func (tuple Tuple) ReferenceOrigins(ctx context.Context) reference.Origins
- func (tuple Tuple) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
- func (tuple Tuple) SemanticTokens(ctx context.Context) []lang.SemanticToken
- type TypeDeclaration
- type UnknownFileFormatError
- type UnresolvedCandidate
- type WriteOnlyAttribute
- type WriteOnlyAttributes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PosFromContext ¶
func WithFilename ¶
WithFilename is not intended to be used outside this package except for testing hooks downstream.
func WithMaxCandidates ¶
WithMaxCandidates is not intended to be used outside this package except for testing hooks downstream.
Types ¶
type Any ¶
type Any struct {
// contains filtered or unexported fields
}
func (Any) CompletionAtPos ¶
func (Any) ReferenceTargets ¶
func (Any) SemanticTokens ¶
func (a Any) SemanticTokens(ctx context.Context) []lang.SemanticToken
type AttributeSymbol ¶
type AttributeSymbol struct { AttrName string ExprKind lang.SymbolExprKind // contains filtered or unexported fields }
AttributeSymbol is Symbol implementation representing an attribute
func (*AttributeSymbol) Equal ¶
func (as *AttributeSymbol) Equal(other Symbol) bool
func (*AttributeSymbol) Name ¶
func (as *AttributeSymbol) Name() string
func (*AttributeSymbol) NestedSymbols ¶
func (as *AttributeSymbol) NestedSymbols() []Symbol
func (*AttributeSymbol) Path ¶
func (as *AttributeSymbol) Path() lang.Path
func (*AttributeSymbol) Range ¶
func (as *AttributeSymbol) Range() hcl.Range
type BlockSymbol ¶
BlockSymbol is Symbol implementation representing a block
func (*BlockSymbol) Equal ¶
func (bs *BlockSymbol) Equal(other Symbol) bool
func (*BlockSymbol) Name ¶
func (bs *BlockSymbol) Name() string
func (*BlockSymbol) NestedSymbols ¶
func (bs *BlockSymbol) NestedSymbols() []Symbol
func (*BlockSymbol) Path ¶
func (bs *BlockSymbol) Path() lang.Path
func (*BlockSymbol) Range ¶
func (bs *BlockSymbol) Range() hcl.Range
type CanInferTypeExpression ¶
type Candidate ¶
type Candidate struct { // Label represents a human-readable name of the candidate // if one exists (otherwise Value is used) Label string // Detail represents a human-readable string with additional // information about this candidate, like symbol information. Detail string Kind lang.CandidateKind // Description represents human-readable description // of the candidate Description lang.MarkupContent // IsDeprecated indicates whether the candidate is deprecated IsDeprecated bool // RawInsertText represents the final text which is used to build the // TextEdit for completion. It should contain quotes when completing // strings. RawInsertText string // ResolveHook represents a resolve hook to call // and any arguments to pass to it ResolveHook *lang.ResolveHook // SortText is an optional string that will be used when comparing this // candidate with other candidates SortText string }
Candidate represents a completion candidate created and returned from a completion hook.
func ExpressionCompletionCandidate ¶
func ExpressionCompletionCandidate(c ExpressionCandidate) Candidate
ExpressionCompletionCandidate converts a simplified ExpressionCandidate into a Candidate while taking care of populating fields and quoting strings
type CompletionFunc ¶
CompletionFunc is the function signature for completion hooks.
The completion func has access to path, filename, pos and maximum candidate count via context:
path, ok := decoder.PathFromContext(ctx) filename, ok := decoder.FilenameFromContext(ctx) pos, ok := decoder.PosFromContext(ctx) maxCandidates, ok := decoder.MaxCandidatesFromContext(ctx)
type CompletionFuncMap ¶
type CompletionFuncMap map[string]CompletionFunc
type CompletionResolveFunc ¶
type CompletionResolveFunc func(ctx context.Context, unresolvedCandidate UnresolvedCandidate) (*ResolvedCandidate, error)
CompletionResolveFunc is the function signature for resolve hooks.
type CompletionResolveFuncMap ¶
type CompletionResolveFuncMap map[string]CompletionResolveFunc
type ConstraintMismatch ¶
type ConstraintMismatch struct {
Expr hcl.Expression
}
func (*ConstraintMismatch) Error ¶
func (cm *ConstraintMismatch) Error() string
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func NewDecoder ¶
func NewDecoder(pathReader PathReader) *Decoder
NewDecoder creates a new Decoder
Decoder is safe for use without any schema, but configuration files are loaded via LoadFile and (optionally) schema is set via SetSchema.
func (*Decoder) CodeLensesForFile ¶
func (d *Decoder) CodeLensesForFile(ctx context.Context, path lang.Path, file string) ([]lang.CodeLens, error)
CodeLensesForFile executes any code lenses in the order declared and returns any errors from all of them. i.e. Error from an earlier lens doesn't prevent future lens from being executed
func (*Decoder) ReferenceOriginsTargetingPos ¶
func (d *Decoder) ReferenceOriginsTargetingPos(path lang.Path, file string, pos hcl.Pos) ReferenceOrigins
func (*Decoder) ReferenceTargetsForOriginAtPos ¶
func (*Decoder) ResolveCandidate ¶
func (d *Decoder) ResolveCandidate(ctx context.Context, unresolvedCandidate UnresolvedCandidate) (*ResolvedCandidate, error)
ResolveCandidate gathers more information for a completion candidate by checking for a resolve hook and executing it. This would be called as part of `completionItem/resolve` LSP method.
func (*Decoder) SetContext ¶
func (d *Decoder) SetContext(ctx DecoderContext)
func (*Decoder) Symbols ¶
Symbols returns a hierarchy of symbols matching the query in all paths. Query can be empty, as per LSP's workspace/symbol request, in which case all symbols are returned.
A symbol is typically represented by a block or an attribute.
Symbols within JSON files require schema to be present for decoding.
type DecoderContext ¶
type DecoderContext struct { // UTM parameters for docs URLs // utm_source parameter, typically language server identification UtmSource string // utm_medium parameter, typically language client identification UtmMedium string // utm_content parameter, e.g. documentHover or documentLink UseUtmContent bool // CodeLenses represents a slice of executable lenses // which will be executed in the exact order they're declared CodeLenses []lang.CodeLensFunc // CompletionHooks represents a map of available hooks for completion. // One can register new hooks by adding an entry to this map. Inside the // attribute schema, one can refer to the hooks map key to enable the hook // execution on CompletionAtPos. CompletionHooks CompletionFuncMap // CompletionResolveHooks represents a map of available hooks for // completion candidate resolving. One can register new hooks by adding an // entry to this map. On completion candidate creation, one can specify a // resolve hook by using the map key string. If a completion candidate has // a resolve hook, ResolveCandidate will execute the hook and return // additional (resolved) data for the completion item. CompletionResolveHooks CompletionResolveFuncMap }
DecoderContext represents global context relevant for all possible paths served by the Decoder
func NewDecoderContext ¶
func NewDecoderContext() DecoderContext
type ExprSymbol ¶
type ExprSymbol struct { ExprName string ExprKind lang.SymbolExprKind // contains filtered or unexported fields }
func (*ExprSymbol) Equal ¶
func (as *ExprSymbol) Equal(other Symbol) bool
func (*ExprSymbol) Name ¶
func (as *ExprSymbol) Name() string
func (*ExprSymbol) NestedSymbols ¶
func (as *ExprSymbol) NestedSymbols() []Symbol
func (*ExprSymbol) Path ¶
func (as *ExprSymbol) Path() lang.Path
func (*ExprSymbol) Range ¶
func (as *ExprSymbol) Range() hcl.Range
type Expression ¶
type Expression interface { CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData SemanticTokens(ctx context.Context) []lang.SemanticToken }
Expression represents an expression capable of providing various LSP features for given hcl.Expression and schema.Constraint.
type ExpressionCandidate ¶
type ExpressionCandidate struct { // Value represents the value to be inserted Value cty.Value // Detail represents a human-readable string with additional // information about this candidate, like symbol information. Detail string // Description represents human-readable description // of the candidate Description lang.MarkupContent // IsDeprecated indicates whether the candidate is deprecated IsDeprecated bool }
ExpressionCandidate is a simplified version of Candidate and the preferred way to create completion candidates from completion hooks for attributes values (expressions). One can use ExpressionCompletionCandidate to convert those into candidates.
type FileNotFoundError ¶
type FileNotFoundError struct {
Filename string
}
func (*FileNotFoundError) Error ¶
func (e *FileNotFoundError) Error() string
type Keyword ¶
type Keyword struct {
// contains filtered or unexported fields
}
func (Keyword) CompletionAtPos ¶
func (Keyword) HoverAtPos ¶
func (Keyword) SemanticTokens ¶
func (kw Keyword) SemanticTokens(ctx context.Context) []lang.SemanticToken
type List ¶
type List struct {
// contains filtered or unexported fields
}
func (List) CompletionAtPos ¶
func (List) HoverAtPos ¶
func (List) ReferenceOrigins ¶
func (List) ReferenceTargets ¶
func (List) SemanticTokens ¶
func (list List) SemanticTokens(ctx context.Context) []lang.SemanticToken
type LiteralType ¶
type LiteralType struct {
// contains filtered or unexported fields
}
func (LiteralType) CompletionAtPos ¶
func (lt LiteralType) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
func (LiteralType) HoverAtPos ¶
func (lt LiteralType) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
func (LiteralType) ReferenceTargets ¶
func (lt LiteralType) ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
func (LiteralType) SemanticTokens ¶
func (lt LiteralType) SemanticTokens(ctx context.Context) []lang.SemanticToken
type LiteralValue ¶
type LiteralValue struct {
// contains filtered or unexported fields
}
func (LiteralValue) CompletionAtPos ¶
func (lv LiteralValue) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
func (LiteralValue) HoverAtPos ¶
func (lv LiteralValue) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
func (LiteralValue) SemanticTokens ¶
func (lv LiteralValue) SemanticTokens(ctx context.Context) []lang.SemanticToken
type Map ¶
type Map struct {
// contains filtered or unexported fields
}
func (Map) CompletionAtPos ¶
func (Map) ReferenceTargets ¶
func (Map) SemanticTokens ¶
func (m Map) SemanticTokens(ctx context.Context) []lang.SemanticToken
type NoSchemaError ¶
type NoSchemaError struct{}
func (*NoSchemaError) Error ¶
func (*NoSchemaError) Error() string
type Object ¶
type Object struct {
// contains filtered or unexported fields
}
func (Object) CompletionAtPos ¶
func (Object) HoverAtPos ¶
func (Object) ReferenceOrigins ¶
func (Object) ReferenceTargets ¶
func (Object) SemanticTokens ¶
func (obj Object) SemanticTokens(ctx context.Context) []lang.SemanticToken
type OneOf ¶
type OneOf struct {
// contains filtered or unexported fields
}
func (OneOf) CompletionAtPos ¶
func (OneOf) HoverAtPos ¶
func (OneOf) ReferenceOrigins ¶
func (OneOf) ReferenceTargets ¶
func (OneOf) SemanticTokens ¶
func (oo OneOf) SemanticTokens(ctx context.Context) []lang.SemanticToken
type PathContext ¶
type PathContext struct { Schema *schema.BodySchema ReferenceOrigins reference.Origins ReferenceTargets reference.Targets Files map[string]*hcl.File Functions map[string]schema.FunctionSignature Validators []validator.Validator }
PathContext represents any context relevant to the lang.Path i.e. anything that is tied either to path or language ID
type PathDecoder ¶
type PathDecoder struct { // PrefillRequiredFields enriches label-based completion candidates // with required attributes and blocks // TODO: Move under DecoderContext PrefillRequiredFields bool // contains filtered or unexported fields }
func (*PathDecoder) CollectReferenceOrigins ¶
func (d *PathDecoder) CollectReferenceOrigins() (reference.Origins, error)
func (*PathDecoder) CollectReferenceTargets ¶
func (d *PathDecoder) CollectReferenceTargets() (reference.Targets, error)
func (*PathDecoder) CollectWriteOnlyAttributes ¶
func (d *PathDecoder) CollectWriteOnlyAttributes() (WriteOnlyAttributes, error)
func (*PathDecoder) CompletionAtPos ¶
func (d *PathDecoder) CompletionAtPos(ctx context.Context, filename string, pos hcl.Pos) (lang.Candidates, error)
CompletionAtPos returns completion candidates for a given position in a file
Schema is required in order to return any candidates and method will return error if there isn't one.
func (*PathDecoder) HoverAtPos ¶
func (*PathDecoder) LinksInFile ¶
func (d *PathDecoder) LinksInFile(filename string) ([]lang.Link, error)
LinksInFile returns links relevant to parts of config in the given file
A link (URI) typically points to the documentation.
func (*PathDecoder) SemanticTokensInFile ¶
func (d *PathDecoder) SemanticTokensInFile(ctx context.Context, filename string) ([]lang.SemanticToken, error)
SemanticTokensInFile returns a sequence of semantic tokens within the config file.
func (*PathDecoder) SignatureAtPos ¶
func (d *PathDecoder) SignatureAtPos(filename string, pos hcl.Pos) (*lang.FunctionSignature, error)
SignatureAtPos returns a function signature for the given pos if pos is inside a FunctionCallExpr
func (*PathDecoder) SymbolsInFile ¶
func (d *PathDecoder) SymbolsInFile(filename string) ([]Symbol, error)
SymbolsInFile returns a hierarchy of symbols within the config file
A symbol is typically represented by a block or an attribute.
Symbols within JSON files require schema to be present for decoding.
func (*PathDecoder) Validate ¶
func (d *PathDecoder) Validate(ctx context.Context) (lang.DiagnosticsMap, error)
Validate returns a set of Diagnostics for all known files
func (*PathDecoder) ValidateFile ¶
func (d *PathDecoder) ValidateFile(ctx context.Context, filename string) (hcl.Diagnostics, error)
ValidateFile validates given file and returns a list of Diagnostics for that file
type PathReader ¶
type PathReader interface { Paths(ctx context.Context) []lang.Path PathContext(path lang.Path) (*PathContext, error) }
func PathReaderFromContext ¶
func PathReaderFromContext(ctx context.Context) (PathReader, error)
type PosOutOfRangeError ¶
type PosOutOfRangeError struct { Filename string Pos hcl.Pos Range hcl.Range }
func (*PosOutOfRangeError) Error ¶
func (e *PosOutOfRangeError) Error() string
type PositionalError ¶
func (*PositionalError) Error ¶
func (e *PositionalError) Error() string
type Reference ¶
type Reference struct {
// contains filtered or unexported fields
}
func (Reference) CompletionAtPos ¶
func (Reference) HoverAtPos ¶
func (Reference) ReferenceOrigins ¶
func (Reference) ReferenceTargets ¶
func (Reference) SemanticTokens ¶
func (ref Reference) SemanticTokens(ctx context.Context) []lang.SemanticToken
type ReferenceOrigin ¶
type ReferenceOrigins ¶
type ReferenceOrigins []ReferenceOrigin
type ReferenceTarget ¶
type ReferenceTargets ¶
type ReferenceTargets []*ReferenceTarget
type ReferenceTargetsExpression ¶
type ReferenceTargetsExpression interface {
ReferenceTargets(ctx context.Context, targetCtx *TargetContext) reference.Targets
}
type ResolvedCandidate ¶
type ResolvedCandidate struct { Description lang.MarkupContent Detail string AdditionalTextEdits []lang.TextEdit }
ResolvedCandidate is the result of a resolve hook and can enrich a completion item by adding additional content to any of the fields.
A field should be empty if no update is intended.
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
func (Set) CompletionAtPos ¶
func (Set) ReferenceOrigins ¶
func (Set) ReferenceTargets ¶
func (Set) SemanticTokens ¶
func (set Set) SemanticTokens(ctx context.Context) []lang.SemanticToken
type Symbol ¶
type Symbol interface { Path() lang.Path Name() string NestedSymbols() []Symbol Range() hcl.Range // contains filtered or unexported methods }
Symbol represents any attribute, or block (and its nested blocks or attributes)
type TargetContext ¶
type TargetContext struct { // FriendlyName is (optional) human-readable name of the expression // interpreted as reference target. FriendlyName string // 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 // in attribute Expr. // // cty.DynamicPseudoType (also known as "any type") will create // reference of the real type if value is present else cty.DynamicPseudoType. AsExprType bool // AsReference defines whether the attribute // is addressable as a type-less reference AsReference bool // ParentAddress represents a resolved "parent" absolute address, // such as data.aws_instance.foo.attr_name. // This may be address of the attribute, or implied element/item address // for complex-type expressions such as object, list, map etc. ParentAddress lang.Address // ParentLocalAddress represents a resolved "parent" local address, // such as self.attr_name. // This may be address of the attribute, or implied element/item address // for complex-type expressions such as object, list, map etc. ParentLocalAddress lang.Address // TargetableFromRangePtr defines where the target is locally targetable // from via the ParentLocalAddress. TargetableFromRangePtr *hcl.Range // ParentRangePtr represents the range of the parent target being collected // e.g. whole object/map item ParentRangePtr *hcl.Range // ParentDefRangePtr represents the range of the parent target's definition // e.g. object attribute name or map key ParentDefRangePtr *hcl.Range }
TargetContext describes context for collecting reference targets
func (*TargetContext) Copy ¶
func (tctx *TargetContext) Copy() *TargetContext
type Tuple ¶
type Tuple struct {
// contains filtered or unexported fields
}
func (Tuple) CompletionAtPos ¶
func (Tuple) HoverAtPos ¶
func (Tuple) ReferenceOrigins ¶
func (Tuple) ReferenceTargets ¶
func (Tuple) SemanticTokens ¶
func (tuple Tuple) SemanticTokens(ctx context.Context) []lang.SemanticToken
type TypeDeclaration ¶
type TypeDeclaration struct {
// contains filtered or unexported fields
}
func (TypeDeclaration) CompletionAtPos ¶
func (td TypeDeclaration) CompletionAtPos(ctx context.Context, pos hcl.Pos) []lang.Candidate
func (TypeDeclaration) HoverAtPos ¶
func (td TypeDeclaration) HoverAtPos(ctx context.Context, pos hcl.Pos) *lang.HoverData
func (TypeDeclaration) SemanticTokens ¶
func (td TypeDeclaration) SemanticTokens(ctx context.Context) []lang.SemanticToken
type UnknownFileFormatError ¶
type UnknownFileFormatError struct {
Filename string
}
func (*UnknownFileFormatError) Error ¶
func (e *UnknownFileFormatError) Error() string
type UnresolvedCandidate ¶
type UnresolvedCandidate struct {
ResolveHook *lang.ResolveHook
}
UnresolvedCandidate contains the information required to call a resolve hook for enriching a completion item with more information.
type WriteOnlyAttribute ¶
type WriteOnlyAttributes ¶
type WriteOnlyAttributes []WriteOnlyAttribute
Source Files
¶
- attribute_candidates.go
- block_candidates.go
- body_candidates.go
- candidates.go
- code_lens.go
- completion_resolve.go
- context.go
- decoder.go
- doc.go
- errors.go
- expr_any.go
- expr_any_completion.go
- expr_any_conditional.go
- expr_any_for.go
- expr_any_hover.go
- expr_any_index.go
- expr_any_operator.go
- expr_any_ref_origins.go
- expr_any_ref_targets.go
- expr_any_semtok.go
- expr_any_template.go
- expr_function.go
- expr_keyword.go
- expr_keyword_completion.go
- expr_keyword_hover.go
- expr_keyword_semtok.go
- expr_list.go
- expr_list_completion.go
- expr_list_hover.go
- expr_list_ref_origins.go
- expr_list_ref_targets.go
- expr_list_semtok.go
- expr_literal_type.go
- expr_literal_type_completion.go
- expr_literal_type_hover.go
- expr_literal_type_ref_targets.go
- expr_literal_type_semtok.go
- expr_literal_value.go
- expr_literal_value_completion.go
- expr_literal_value_hover.go
- expr_literal_value_semtok.go
- expr_map.go
- expr_map_completion.go
- expr_map_hover.go
- expr_map_ref_origins.go
- expr_map_ref_targets.go
- expr_map_semtok.go
- expr_object.go
- expr_object_completion.go
- expr_object_hover.go
- expr_object_ref_origins.go
- expr_object_ref_targets.go
- expr_object_semtok.go
- expr_one_of.go
- expr_one_of_completion.go
- expr_one_of_hover.go
- expr_one_of_ref_origins.go
- expr_one_of_ref_targets.go
- expr_one_of_semtok.go
- expr_reference.go
- expr_reference_completion.go
- expr_reference_hover.go
- expr_reference_ref_origins.go
- expr_reference_ref_targets.go
- expr_reference_semtok.go
- expr_set.go
- expr_set_completion.go
- expr_set_hover.go
- expr_set_ref_origins.go
- expr_set_ref_targets.go
- expr_set_semtok.go
- expr_tuple.go
- expr_tuple_completion.go
- expr_tuple_hover.go
- expr_tuple_ref_origins.go
- expr_tuple_ref_targets.go
- expr_tuple_semtok.go
- expr_type_declaration.go
- expr_type_declaration_completion.go
- expr_type_declaration_hover.go
- expr_type_declaration_semtok.go
- expr_unknown.go
- expression.go
- expression_candidates.go
- extension_schemas.go
- hover.go
- label_candidates.go
- links.go
- path_context.go
- path_decoder.go
- path_reader.go
- reference_origin.go
- reference_origins.go
- reference_target.go
- reference_targets.go
- semantic_tokens.go
- signature.go
- symbol.go
- symbols.go
- validate.go
- write_only_attributes.go