Manually controls how and where to fold your code
In your Settings:
"folding": {
"*": {
"begin": "{{{",
"end": "}}}"
},
"typescript": {
"begin": "#region",
"end": "#endregion"
},
"javascriptreact": [
{
"begin": "{/*",
"end": "*/}"
},
{
"begin": "<",
"end": "/>"
}
],
"php":[
{
"comment":"//"
},
{
"begin": "\/*",
"end": "*\/",
"offsetTop":1,
},
{
"begin":"<?",
"end":"?>"
},
{
"begin": "{",
"end": "}"
},
{
"begin": "[",
"end": "]"
},
{
"begin": "(",
"end": ")"
},
]
}
or with regex:
"folding": {
"*": {
"beginRegex": "\\{\\{\\{",
"endRegex": "\\}\\}\\}"
},
"typescript": {
"beginRegex": "#region",
"endRegex": "#endregion"
},
"javascriptreact": [
{
"beginRegex": "\\{/\\*",
"endRegex": "\\*/\\}"
},
{
"begin": "<",
"end": "/>"
}
],
"php":{
"comment":"//",
"beginRegex": "\\(|\\[|\\{|\\<\\?",
"endRegex": "\\}|\\]|\\)|\\?\\>"
}
}
folding.*.begin
&folding.*.end
matching folding ranges using stringfolding.*.beginRegex
&folding.*.endRegex
matching folding range using regular expressionsfolding.*.offsetTop
show first line when collapsedfolding.*.offsetBottom
show last line when collapsedfolding.*.comment
mismatched entire line of comments using stringfolding.*.autoFix
multi-line comments fix non-matching folds
The configuration's properties begin
and end
should be renamed as beginRegex
and endRegex
.
- It's unable to remove existing folding
Enjoy!