nvim_runtime_lua

lsp.FoldingRange

Represents a folding range. To be valid, start and end line must be bigger than zero and smaller than the number of lines in the document. Clients are free to ignore invalid ranges.

@since 3.17.0

Fields6

FoldingRange.startLine : uinteger

The zero-based start line of the range to fold. The folded area starts after the line's last character. To be valid, the end must be zero or larger and smaller than the number of lines in the document.

FoldingRange.startCharacter : uinteger | nil

The zero-based character offset from where the folded range starts. If not defined, defaults to the length of the start line.

FoldingRange.endLine : uinteger

The zero-based end line of the range to fold. The folded area ends with the line's last character. To be valid, the end must be zero or larger and smaller than the number of lines in the document.

FoldingRange.endCharacter : uinteger | nil

The zero-based character offset before the folded range ends. If not defined, defaults to the length of the end line.

FoldingRange.kind : lsp.FoldingRangeKind | nil

Describes the kind of the folding range such as 'comment' or 'region'. The kind is used to categorize folding ranges and used by commands like 'Fold all comments'. See {@link FoldingRangeKind} for an enumeration of standardized kinds.

FoldingRange.collapsedText : nil | string