Closed alexqfredrickson closed 6 years ago
ST's code folding arrows in the gutter are currently based on indentation only, there is currently no way to configure that any differently. See https://github.com/SublimeTextIssues/Core/issues/101 for an open feature request.
However, you can always select any text that you want to fold and go to the Edit menu -> Code Folding -> Fold (or press the appropriate key binding). If you want to quickly select the entire comment, you could try Selection -> Expand Selection to Scope while the caret is inside the comment. And of course, as ST is customizable, you could combine the two into a new keybinding :)
Thanks Keith! Ideally I wanted one of those clicky-arrow thingies, but I can absolutely live with this.
The "workaround" I have been using is that PowerShell also recognizes docstrings located immediately underneath function declarations (which are collapsible):
Function Clean-XML() {
<#
.DESCRIPTION
Escapes characters in XML requests.
.EXAMPLE
Clean-XML -text "Hello <world>"
#>
param(
[string]$text =$(throw "Parameter missing: -text")
)
#do things
return $text
}
It would be a nice feature to be allow code-folding for multi-line comment blocks.
Comment blocks are used to define documentation for functions, and they can get fairly verbose: