java.lang.Object
org.eclipse.lemminx.extensions.relaxng.grammar.rnc.folding.RNCFoldings

public class RNCFoldings extends Object
Provides folding ranges for RNC (RELAX NG Compact Syntax) documents.

Folding ranges are computed from the AST (RNCDocument). Each top-level declaration (define, start, include, div, element, attribute) that spans more than one line produces a FoldingRangeKind.Region fold. The range of a define/start extends to just before the next declaration (same approach as document symbols).

Three kinds of folding ranges are computed:

  • Region (declaration) — any top-level declaration that spans more than one line.
  • Region (declaration group) — consecutive namespace/datatypes declarations grouped together.
  • Comment — consecutive runs of single-line comments (# or ##) that span more than one line.
  • Constructor Details

    • RNCFoldings

      public RNCFoldings()
  • Method Details

    • getFoldingRanges

      public List<org.eclipse.lsp4j.FoldingRange> getFoldingRanges(RNCDocument rncDocument, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)
      Computes folding ranges for the given RNC document.
      Parameters:
      rncDocument - the parsed RNC document (AST).
      cancelChecker - used to abort the computation if the document changes.
      Returns:
      a list of FoldingRange objects, possibly empty.