hcl

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2025 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const TokenType_Class = "class"
View Source
const TokenType_Comment = "comment"
View Source
const TokenType_Keyword = "keyword"
View Source
const TokenType_Number = "number"
View Source
const TokenType_Operator = "operator"
View Source
const TokenType_Property = "property"
View Source
const TokenType_String = "string"
View Source
const TokenType_Type = "type"
View Source
const TokenType_Variable = "variable"

Variables

SemanticTokenTypes is the list of semantic token types that the language server supports and will be included in the capabilities response payload to the client's initialize request.

Functions

func CalculateBlockLocation

func CalculateBlockLocation(definitionLinkSupport bool, input []byte, body *hclsyntax.Body, documentURI uri.URI, sourceRange hcl.Range, blockName, name string, variable bool) any

CalculateBlockLocation finds a block with the specified name and returns it. If variable is true then it will also look at the top-level attributes of the HCL file and resolve to those if the names match.

func CodeLens

func CodeLens(ctx context.Context, filename string, doc document.BakeHCLDocument) ([]protocol.CodeLens, error)

func Definition

func Definition(ctx context.Context, definitionLinkSupport bool, manager *document.Manager, documentURI uri.URI, doc document.BakeHCLDocument, position protocol.Position) (any, error)

func DocumentHighlight

func DocumentHighlight(document document.BakeHCLDocument, position protocol.Position) ([]protocol.DocumentHighlight, error)
func DocumentLink(ctx context.Context, documentURI protocol.URI, document document.BakeHCLDocument) ([]protocol.DocumentLink, error)

func DocumentSymbol

func DocumentSymbol(ctx context.Context, filename string, doc document.BakeHCLDocument) (result []any, err error)

func Hover

func LiteralValue

func LiteralValue(expr hclsyntax.Expression) bool

func LocalDockerfile

func LocalDockerfile(u *url.URL) (string, error)

func NewBakeHCLDiagnosticsCollector

func NewBakeHCLDiagnosticsCollector(docs *document.Manager, scout scout.Service) textdocument.DiagnosticsCollector

func OpenDockerfile

func OpenDockerfile(ctx context.Context, manager *document.Manager, path string) ([]byte, []*parser.Node)

func ParseDockerfile

func ParseDockerfile(dockerfilePath string) ([]byte, *parser.Result, error)

func Quoted

func Quoted(s string) bool

func ResolveAttributeValue

func ResolveAttributeValue(ctx context.Context, definitionLinkSupport bool, manager *document.Manager, doc document.BakeHCLDocument, body *hclsyntax.Body, documentURI uri.URI, position protocol.Position, sourceBlock *hclsyntax.Block, attribute *hclsyntax.Attribute) any

func ResolveExpression

func ResolveExpression(ctx context.Context, definitionLinkSupport bool, manager *document.Manager, doc document.BakeHCLDocument, body *hclsyntax.Body, documentURI uri.URI, position protocol.Position, sourceBlock *hclsyntax.Block, attributeName string, expression hclsyntax.Expression) any

func SemanticTokenTypeIndex

func SemanticTokenTypeIndex(tokenType string) uint32

func SemanticTokensFull

func SemanticTokensFull(ctx context.Context, doc document.BakeHCLDocument, filename string) (*protocol.SemanticTokens, error)

func TokenType

func TokenType(hclType lang.SemanticTokenType) uint32

func UnwrapToHCL

func UnwrapToHCL(err error) hcl.Diagnostics

Types

type BakeHCLDiagnosticsCollector

type BakeHCLDiagnosticsCollector struct {
	// contains filtered or unexported fields
}

func (*BakeHCLDiagnosticsCollector) CollectDiagnostics

func (c *BakeHCLDiagnosticsCollector) CollectDiagnostics(source, workspaceFolder string, doc document.Document, text string) []protocol.Diagnostic

func (*BakeHCLDiagnosticsCollector) SupportsLanguageIdentifier

func (c *BakeHCLDiagnosticsCollector) SupportsLanguageIdentifier(languageIdentifier protocol.LanguageIdentifier) bool

type BakePrintOutput

type BakePrintOutput struct {
	Group  map[string]bake.Group  `json:"group,omitempty"`
	Target map[string]bake.Target `json:"target"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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