Open strider72 opened 1 year ago
As a side note: you recommend things but don't explain what they do. For example, I have no idea what the "{{{" default does
Finally! I basically just shoved it all into the language specific block...
"[vb]": {
"editor.foldingStrategy": "auto",
"editor.defaultFoldingRangeProvider": "zokugun.explicit-folding",
"explicitFolding.rules": [
{
"begin": "{{{",
"end": "}}}"
},
... my folding rules ...
}
HOWEVER, it seems to be unstable. For example, if I switch to a PHP file, the default folding for PHP works fine, but when I then go back to ASP, the folding doesn't work until I restart VSCode. A bug, it seems.
ALSO: With the above solution, I believe this plugin is still affecting other languages. So not entirely a solution to the question posed.
You can remove the {{{
/}}}
, it's just an example to use Emacs folding mode.
HOWEVER, it seems to be unstable. For example, if I switch to a PHP file, the default folding for PHP works fine, but when I then go back to ASP, the folding doesn't work until I restart VSCode. A bug, it seems.
It should work but a bug can always be present... I will have to test...
Can you post your full config for this extension?
My grep is rusty, so no doubt you will see some clumsiness. This is my entire settings.json
file.
{
"files.associations": {
"*.asp": "vb",
"*.ahtml": "vb"
},
"security.workspace.trust.untrustedFiles": "open",
"editor.insertSpaces": false,
"editor.wordWrap": "on",
"git.ignoreLimitWarning": true,
"window.restoreWindows": "preserve",
"editor.matchBrackets": "never",
"workbench.editor.enablePreview": false,
"editor.accessibilitySupport": "off",
"emmet.preferences": {
},
"editor.codeActionsOnSave": {
},
"[vb]": {
"editor.foldingStrategy": "auto",
"editor.defaultFoldingRangeProvider": "zokugun.explicit-folding",
"explicitFolding.rules": [
{
"beginRegex": "^'region ",
"endRegex": "^'endregion",
"foldLastLine": true
},
{
"beginRegex": "^[Ff]unction ",
"endRegex": "^[Ee]nd [Ff]unction$",
"foldLastLine": true
},
{
"beginRegex": "^([\\s]+?)[Ff]unction ",
"endRegex": "^\\1[Ee]nd [Ff]unction$",
"foldLastLine": true
},
{
"beginRegex": "^[Ss]ub ",
"endRegex": "^[Ee]nd [Ss]ub$",
"foldLastLine": true
},
{
"beginRegex": "^([\\s]+?)[Ss]ub ",
"endRegex": "^\\1[Ee]nd [Ss]ub$",
"foldLastLine": true
},
{
"beginRegex": "^[Ii]f(.+)[Tt]hen$",
"middleRegex": "^[Ee]lse",
"endRegex": "^[Ee]nd [Ii]f$",
"foldLastLine": false
},
{
"beginRegex": "^([\\s]+?)[Ii]f(.+)[Tt]hen$",
"middleRegex": "^\\1[Ee]lse",
"endRegex": "^\\1[Ee]nd [Ii]f$",
"foldLastLine": false
}
]
}
}
In theory doesn't make a difference, but FYI I'm using VSCodium -- the fully open source version of VSCode. Also, I'm coding in old school ASP, not .NET.
I'm the main maintainer to VSCodium 😉
Awesome -- big fan of FOSS :-) Only starting to dip my toe into Linux on desktop, but running degoogled Android for over a year now.
I do not want to use this be default, but only for languages I specify. How do I tell VSCode (actually Codium) to ignore this plugin unless I've specified it for a specific language?
Very frustrating that the defaultFoldingRangeProvider setting seems to lack a "default" setting. Pretty sure that's VSCode, not you, but is there a workaround? (Maybe set a "do nothing" default rule for your plugin?)
I'm trying to use this for ASP/VBScript, but if I get it working right in my ASP files, it's broken in other languages. I want it to ignore all other lanugages. (That is, I want you lkugin only for my vb files.)