First navigate to D:\Program Files\Microsoft VS Code\resources\app\extensions, change the path to its own, open the Python and LUA directories, and modify the Language-configurat Ion.json files. python
Python defaults have been matched, but not well matched, only support #region, if there is a space between # and region (# Region) is not, the folding changed to the following is good:
"Folding": {
"Offside": true,
"markers": {
"start": "^\\s*#\\s*region\\b",
"End": "^\\s*#\\s* endregion\\b "
}
}
Lua
Lua is not matched by default, and the last paragraph in the configuration file adds
"Folding": {
"Offside": true,
"markers": {
"start": "^\\s*--\\s*region\\b",
"End": "^\\s*--\\s* endregion\\b "
}
}
After the change, remember to restart the Vscode will not take effect. PostScript tried to add multiple marker, but failed to see the other language configuration seems to be used to separate, but did not succeed, estimated with the delimiter I used, I used the {{&}}, these two have special purpose in JSON, plus the escape character \ \ Still does not take effect, give up. Also tried to support this in sublime, but did not find the place to match, in this respect sublime is too far, and N not update once, more and more can't keep up with the trend. Using #region in Python is a convention, and Python's most popular IDE Pycharm is inherently supportive of region, although this is not part of the Python syntax (indeterminate, sublime does not support region inference). Lua does not--region/endregion this syntax, there is no IDE or editor support, and this feature is only to facilitate the contraction of the code, so you can not region, such as I wanted to use {{...}}, but did not succeed, you have what you want to use can play their own , I will not toss, use region bar, at least many languages use this.
Reference Document: HTTPS://GITHUB.COM/MICROSOFT/VSCODE-PYTHON/ISSUES/33