ahkpp
ahkpp copied to clipboard
Add unit tests for folding regions and language configuration
Description
Language configuration is determined by ahk.configuration.json
, but there is no current way to ensure the regular expressions defined there work correctly in editor files.
Reproduction steps
Steps to reproduce the behavior:
- Change the folding regions regular expression
- Test the extension
- Note the tests still pass since there is no automated test to ensure folding regions are valid
Expected behavior
Tests fail when folding regions change.
Additional context
Language Configuration Guide | Visual Studio Code Extension API
Hi so does this like include stuff like ;#region ;region etc?
The current regexes in ahk.configuration.json
don't match #regions
anyway? If this is naïve code then feel free to change it, but it's working for me:
"folding": {
"markers": {
"start": "^;.*\\bregion\\b",
"end": "^;.*\\bendregion\\b"
}
}
File location: \.vscode\extensions\mark-wiemer.vscode-autohotkey-plus-plus-2.8.4\ahk.configuration.json
@Braber01 yes it's meant to support code like that, and yes @Cirieno I know the code change should be simple. I've been struggling to set up some automated test suites to make sure the regexes are robust and well-documented because regexes are notoriously hard to work with. I'm still tracking this issue, if we can figure out a way to easily test this behavior I'd be happy to accept a PR to fix it :)
closing as dupe, this will come when I work on the relevant files