You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on #1428 I thought of another possible issue with the syntax folding. Currently regions and comment blocks are detected as the same thing which will cause issues when comments are not separated by empty lines.
Previously the syntax folding feature would not correctly identify comment
blocks and comment regions if they appeared all together. This commit changes
the comment block detection to ignore line comments that start with region and
endregion, i.e. region block start/end directives. This commit also adds test
for this scenario.
* (maint) Refactor region folding detection
Previously the region comment detection used a little convoluted method to
detect regions in a document. This commit simplifies the detection by
extracting the line from the document and using regex's similar to that used by
the PowerShell language configuration. This also removes the need for the
emptyline and subsequentText method calls. While the performance of the folder
is pretty quick, this should in theory make it faster on larger documents by
doing less calls to the VSCode Document API.
* (GH-1437) Fix detecting contiguous comment blocks and regions
Previously the syntax folding feature would not correctly identify comment
blocks and comment regions if they appeared all together. This commit changes
the comment block detection to ignore line comments that start with region and
endregion, i.e. region block start/end directives. This commit also adds test
for this scenario.
System Details
$PSVersionTable
: N/AIssue Description
While working on #1428 I thought of another possible issue with the syntax folding. Currently regions and comment blocks are detected as the same thing which will cause issues when comments are not separated by empty lines.
Given a script of
Expected Folding Regions
Actual Folding regions
The text was updated successfully, but these errors were encountered: