lang

package
v0.0.0-...-b4bb674 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 27, 2024 License: MPL-2.0 Imports: 5 Imported by: 6

Documentation

Index

Constants

View Source
const (
	TokenModifierDependent = SemanticTokenModifier("hcl-dependent")
)

Variables

Functions

This section is empty.

Types

type Address

type Address []AddressStep

func TraversalToAddress

func TraversalToAddress(traversal hcl.Traversal) (Address, error)

func (Address) Copy

func (a Address) Copy() Address

func (Address) Equals

func (a Address) Equals(addr Address) bool

func (Address) FirstSteps

func (a Address) FirstSteps(steps uint) Address

func (Address) Marshal

func (a Address) Marshal() ([]byte, error)

func (Address) String

func (a Address) String() string

type AddressStep

type AddressStep interface {
	String() string
	// contains filtered or unexported methods
}

type AttrStep

type AttrStep struct {
	Name string `json:"name"`
}

func (AttrStep) String

func (s AttrStep) String() string

type Candidate

type Candidate struct {
	Label               string
	Description         MarkupContent
	Detail              string
	IsDeprecated        bool
	TextEdit            TextEdit
	AdditionalTextEdits []TextEdit
	Kind                CandidateKind

	// TriggerSuggest allows server to instruct the client whether
	// to reopen candidate suggestion popup after insertion
	TriggerSuggest bool

	// ResolveHook allows resolution of additional information
	// for a completion candidate via ResolveCandidate.
	ResolveHook *ResolveHook

	// SortText is an optional string that will be used when comparing this
	// candidate with other candidates
	SortText string
}

Candidate represents a completion candidate in the form of an attribute, block, or a label

type CandidateKind

type CandidateKind uint
const (
	NilCandidateKind CandidateKind = iota

	// structural kinds
	AttributeCandidateKind
	BlockCandidateKind
	LabelCandidateKind

	// expressions
	BoolCandidateKind
	KeywordCandidateKind
	ListCandidateKind
	MapCandidateKind
	NumberCandidateKind
	ObjectCandidateKind
	SetCandidateKind
	StringCandidateKind
	TupleCandidateKind
	ReferenceCandidateKind
	FunctionCandidateKind
)

func (CandidateKind) String

func (i CandidateKind) String() string

type Candidates

type Candidates struct {
	List       []Candidate
	IsComplete bool
}

Candidates represents a list of candidates and indication whether the list is complete or if it needs further filtering because there is too many candidates.

Decoder has an upper limit for the number of candidates it can return and when the limit is reached, the list is considered incomplete.

func CompleteCandidates

func CompleteCandidates(list []Candidate) Candidates

CompleteCandidates creates a static (complete) list of candidates

NewCandidates should be used at runtime instead, but CompleteCandidates provides a syntactic sugar useful in tests.

func IncompleteCandidates

func IncompleteCandidates(list []Candidate) Candidates

IncompleteCandidates creates a static list of candidates

NewCandidates should be used at runtime instead, but IncompleteCandidates provides a syntactic sugar useful in tests.

func NewCandidates

func NewCandidates() Candidates

NewCandidates creates a new (incomplete) list of candidates to be appended to.

func ZeroCandidates

func ZeroCandidates() Candidates

ZeroCandidates returns a (complete) "list" of no candidates

func (Candidates) Len

func (ca Candidates) Len() int

func (Candidates) Less

func (ca Candidates) Less(i, j int) bool

func (Candidates) Swap

func (ca Candidates) Swap(i, j int)

type CodeLens

type CodeLens struct {
	Range   hcl.Range
	Command Command
}

type CodeLensFunc

type CodeLensFunc func(ctx context.Context, path Path, file string) ([]CodeLens, error)

type Command

type Command struct {
	Title     string
	ID        string
	Arguments []CommandArgument
}

type CommandArgument

type CommandArgument interface {
	MarshalJSON() ([]byte, error)
}

type CompletionHook

type CompletionHook struct {
	Name string
}

type CompletionHooks

type CompletionHooks []CompletionHook

func (CompletionHooks) Copy

func (chs CompletionHooks) Copy() CompletionHooks

type DiagnosticsMap

type DiagnosticsMap map[string]hcl.Diagnostics

func (DiagnosticsMap) Count

func (dm DiagnosticsMap) Count() int

Count returns the number of diagnostics for all files

func (DiagnosticsMap) Extend

func (dm DiagnosticsMap) Extend(diagMap DiagnosticsMap) DiagnosticsMap

type FunctionParameter

type FunctionParameter struct {
	Name string

	// Description is an optional human-readable description
	// of the parameter.
	Description MarkupContent
}

type FunctionSignature

type FunctionSignature struct {
	Name string

	// Description is an optional human-readable description
	// of the function.
	Description MarkupContent

	// Parameters is an ordered list of the function's parameters.
	Parameters []FunctionParameter

	// ActiveParameter is an index marking the parameter a user is currently
	// editing. It should lie inside the range of Parameters.
	ActiveParameter uint32
}

type HoverData

type HoverData struct {
	Content MarkupContent
	Range   hcl.Range
}

type IndexStep

type IndexStep struct {
	Key cty.Value `json:"key"`
}

func (IndexStep) String

func (s IndexStep) String() string
type Link struct {
	URI     string
	Tooltip string
	Range   hcl.Range
}

type LiteralTypeKind

type LiteralTypeKind struct {
	Type cty.Type
}

type MarkupContent

type MarkupContent struct {
	Value string
	Kind  MarkupKind
}

MarkupContent represents human-readable content which can be represented as Markdown or plaintext for backwards-compatible reasons.

func Markdown

func Markdown(value string) MarkupContent

func PlainText

func PlainText(value string) MarkupContent

type MarkupKind

type MarkupKind uint
const (
	NilKind MarkupKind = iota
	PlainTextKind
	MarkdownKind
)

func (MarkupKind) String

func (i MarkupKind) String() string

type ObjectConsExprKind

type ObjectConsExprKind struct{}

type Path

type Path struct {
	Path       string
	LanguageID string
}

func (Path) Equals

func (path Path) Equals(p Path) bool

type ReferenceExprKind

type ReferenceExprKind struct{}

type ResolveHook

type ResolveHook struct {
	Name string `json:"resolve_hook,omitempty"`
	Path string `json:"path,omitempty"`
}

type RootStep

type RootStep struct {
	Name string `json:"name"`
}

func (RootStep) String

func (s RootStep) String() string

type ScopeId

type ScopeId string

type SemanticToken

type SemanticToken struct {
	Type      SemanticTokenType
	Modifiers SemanticTokenModifiers
	Range     hcl.Range
}

type SemanticTokenModifier

type SemanticTokenModifier string

type SemanticTokenModifiers

type SemanticTokenModifiers []SemanticTokenModifier

func (SemanticTokenModifiers) Copy

type SemanticTokenType

type SemanticTokenType string
const (
	// structural tokens
	TokenAttrName   SemanticTokenType = "hcl-attrName"
	TokenBlockType  SemanticTokenType = "hcl-blockType"
	TokenBlockLabel SemanticTokenType = "hcl-blockLabel"

	// expressions
	TokenBool          SemanticTokenType = "hcl-bool"
	TokenString        SemanticTokenType = "hcl-string"
	TokenNumber        SemanticTokenType = "hcl-number"
	TokenObjectKey     SemanticTokenType = "hcl-objectKey"
	TokenMapKey        SemanticTokenType = "hcl-mapKey"
	TokenKeyword       SemanticTokenType = "hcl-keyword"
	TokenReferenceStep SemanticTokenType = "hcl-referenceStep"
	TokenTypeComplex   SemanticTokenType = "hcl-typeComplex"
	TokenTypePrimitive SemanticTokenType = "hcl-typePrimitive"
	TokenFunctionName  SemanticTokenType = "hcl-functionName"
)

type SemanticTokenTypes

type SemanticTokenTypes []SemanticTokenType

type SymbolExprKind

type SymbolExprKind interface {
	// contains filtered or unexported methods
}

type TextEdit

type TextEdit struct {
	Range   hcl.Range
	NewText string
	Snippet string
}

TextEdit represents a change (edit) of an HCL config file in the form of a Snippet *and* NewText to replace the given Range.

Snippet and NewText are equivalent, but NewText is provided for backwards-compatible reasons. Snippet uses 1-indexed placeholders, such as name = ${1:value}.

type TupleConsExprKind

type TupleConsExprKind struct{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL