vscode-explicit-folding
vscode-explicit-folding copied to clipboard
Folding rule for ARM asm language yielding 'SyntaxError: Expected [gimsuxyUJX] or end of input but found " "'
Versions used and details of configuration
VSCode 1.67.1 (system setup) Explicit Folding v0.21.0
Description of issue
I have this rule in my settings.JSON:
"explicitFolding.rules": {
"arm": [
{
"beginRegex": "\/\/ <MAIN>",
"endRegex": "\/\/ <\/MAIN>"
}
]
}
with the additional settings:
"editor.showFoldingControls": "always",
"editor.foldingStrategy": "auto",
"explicitFolding.debug": true
And I'm testing it on this code in a .S file (ARM assembly code, specifically ARMv7-M):
// <MAIN>
// </MAIN>
If I understand how the extension works, there should be a folding region created between these two lines, but as far as I can tell it's not working; there's no white arrow in the gutter like there usually is. And the debug output is baffling me; what is gimsuxyUJX??:
SyntaxError: Expected [gimsuxyUJX] or end of input but " " found.
[document] lang: arm, fileName: c:\Users\adnan\Desktop\Work\2022\COMP2300\labs\comp2300-2022-lab-pack-4\week-12\src\main.S
[main] regex: /a^/
[document] foldings: []
Tests attempted
- Tried turning off all other extensions, no luck
You need to double escape:
"[arm]": {
"explicitFolding.rules": [
{
"beginRegex": "\\/\\/ <MAIN>",
"endRegex": "\\/\\/ <\\/MAIN>"
},
],
},
or use string:
"[arm]": {
"explicitFolding.rules": [
{
"begin": "// <MAIN>",
"end": "// </MAIN>"
},
],
},
@Tridecatrix Have you been able to fix your issue?
Oh I believe yes, think I just forgot to close it sorry