Closed depascalis closed 2 years ago
The extension is working line per line so the end of the line is the end of the expression i.e. $
.
By the way, endRegex
is with small x.
"endRegex": "^$"
wont work because of the double protection against regex that could match anything (to avoid infinite loop). I will fix that issue.
I've updated the extension to v0.18.2
(should be available soon) and tested with the following setting:
"[jsonc]": {
"explicitFolding.debug": true,
"explicitFolding.rules": [
{
"beginRegex": "\\/\\/",
"endRegex": "^\\s*$",
"bypassProtection": true
}
]
}
Awesome work, thanks for the quick fix @daiyam 👏🏻
I actually tried that exact expression before "endRegex": "^\\s*$"
, it's working with bypassProtection
now.
endRegeX was just a typo, but thanks :)
So linefeed \n
won't be implemented? I saw a error message that listed valid tokens, \n
was included in that list.
Yes, \n
won't be implemented. The message must be from the parser used to detect capture groups and more.
Ok thanks, maybe remove any references to \n
to avoid confusion.
Describe the issue
Unable to match line feed with regex. Whenever
\n
is used the regex brakes.Side issue
When
\n
is used without escaping it there is no error thrown. Example:"endRegex": "\n"
Should be:"endRegex": "\\n"
To reproduce
Code Example
Settings
I'm not looking for an alternate solution, the code example above is just an example to simplify the issue.
Expected behavior
Posibillity to match linefeed
\n
The whole code example, from//
to the next empty line, should be foldable.Expected behavior of side issue
Throw error when not escaping
\n
Additional context
Related issue https://github.com/zokugun/vscode-explicit-folding/issues/8
It is possible that this lies upstream. I could not find the cause when taking a quick look at the codebase.