VS Code has a facility called 'folding marker', where a programmer can add a non-executable tag to a line of script indicating that this section should be the beginning of a folding region. It also enables a neat feature where special comments to appear in the preview/navigation pane of editor, as described in this tweet.
The tokens used to achieve this are specified in the file language-configuration.json. Here is the relevant section:
"folding": {
"markers": {
"start": "^\\s*#pragma\\s+region\\b",
"end": "^\\s*#pragma\\s+endregion\\b"
}
}
Unfortunately, this uses the default C++ syntax for the region
#pragma region comment
and
#pragma endregion
which works to show the comments in preview but causes a syntax error in CONTROL.
A simple fix is to change the regex to the JavaScript setting
"folding": {
"markers": {
"start": "^\\s*//\\s*#?region\\b",
"end": "^\\s*//\\s*#?endregion\\b"
}
}
which enables the syntax
// #region comment
and
// #endregion
which works beautifully:

VS Code has a facility called 'folding marker', where a programmer can add a non-executable tag to a line of script indicating that this section should be the beginning of a folding region. It also enables a neat feature where special comments to appear in the preview/navigation pane of editor, as described in this tweet.
The tokens used to achieve this are specified in the file language-configuration.json. Here is the relevant section:
Unfortunately, this uses the default C++ syntax for the region
#pragma region commentand
#pragma endregionwhich works to show the comments in preview but causes a syntax error in CONTROL.
A simple fix is to change the regex to the JavaScript setting
which enables the syntax
// #region commentand
// #endregionwhich works beautifully:
