folding

package
v0.2.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package folding provides folding range support for HCL files. This implementation is dependent on the calling extension (vscode versus intellij) that expect slightly different ranges for folding behavior.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Range

type Range struct {
	StartLine   int
	StartColumn int
	EndLine     int
	EndColumn   int
	Kind        string // "comment", "imports", or "region"
}

Range represents a foldable range in a document. Line and Column are 1-based (HCL convention).

func Collect

func Collect(file *hcl.File, b decoder.LangServerBehavior) []Range

Collect returns all foldable ranges for the given HCL file. It folds blocks and object expressions with '{' delimiters. Tuples/lists with '[]' are not folded due to lsp4ij limitations.

Jump to

Keyboard shortcuts

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