@@ -67,7 +67,21 @@ or expanded, which may be useful for hiding content that is not relevant to the
6767 src={require('./assets/lsp/folding.png').default}
6868 alt="Screenshot of folding ranges as displayed in Zed"/>
6969
70- Regal supports folding ranges for blocks, imports and comments.
70+ Regal provides folding ranges for all AST nodes that may span more than a single line, like rules, functions,
71+ comprehensions, collection literals, and more. The server additionally provides folding ranges for import and comment
72+ "blocks", where consecutive imports and comments are grouped together in a single folding range.
73+
74+ The language server specification allows editors to present a few
75+ [ capabilities] ( https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#foldingRangeClientCapabilities )
76+ related to folding ranges. The two most relevant to Regal are both supported by the language server:
77+
78+ - ` lineFoldingOnly ` tells Regal that the editor only supports folding whole lines, and that folding always starts and
79+ ends at the beginning of a line. When set to ` true ` (which it commonly is by default), Regal will skip calculating
80+ character positions for where folding should start and end, which generally results in faster rendering of the folding
81+ ranges.
82+ - ` rangeLimit ` is a positive integer value that when provided tells Regal the maximum number of folding ranges that the
83+ server should return. While Regal honors this setting, the number is commonly in the thousands (for example, VS Code's
84+ default is 5000), which is much higher than the number of folding ranges that a typical Rego file would have.
7185
7286### Document and workspace symbols
7387
0 commit comments