IndentationCalculator

Provides stateless utility methods for indentation calculations and analysis. This class contains pure functions that compute indentation-related values without maintaining any state. All methods are static and can be used independently without creating an instance. Typical operations include: - Computing indentation from preceding elements - Analyzing indentation context for enforcement - Creating standard indentation blocks - Extracting indentation from token sequences

See also

for stateful indentation management

Types

Link copied to clipboard
open class EnforcingContext
Context information for enforcing indentation.

Functions

Link copied to clipboard
Analyzes the indentation enforcement context at a given position in the node text.
Link copied to clipboard
Computes the indentation that should be used based on the elements preceding the current position.
Link copied to clipboard
Creates a single indentation block of STANDARD_INDENTATION_SIZE spaces.
Link copied to clipboard
open fun enforceIndentation(nodeText: NodeText, index: Int, charactersToPreserve: Int): Int
Applies indentation enforcement at the specified position, preserving the specified number of characters.
Link copied to clipboard
Extracts the indentation portion from a list of elements.
Link copied to clipboard
open fun removeExcessIndentation(nodeText: NodeText, startIndex: Int, count: Int): Int
Removes excess indentation characters from the node text.