vscode-powershell: PowerShell Extension 1.8.1 breaks editor folding on region tags
System Details
- Operating system name and version: Windows 10.1803.17134.137
- VSCode Version: 1.25.0
- PowerShell extension version: 1.8.1
- Output from
$PSVersionTable: Name Value
PSVersion 5.1.17134.137 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} BuildVersion 10.0.17134.137 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
$pseditor.EditorServicesVersion code --list-extensions --show-versions $PSVersionTable 1.25.0 0f080e5267e829de46638128001aeb7ca2d6d50e x64
Major Minor Build Revision
1 8 1 0 cdsama.tortoise-svn-for-vscode@0.1.1 dakara.transformer@1.6.0 emmanuelbeziat.vscode-great-icons@2.1.36 GrapeCity.gc-excelviewer@2.1.24 ilich8086.coldfusion@1.0.1 mechatroner.rainbow-csv@0.4.2 ms-vscode.csharp@1.15.2 ms-vscode.PowerShell@1.8.1 PKief.material-icon-theme@3.5.1 schneiderpat.aspnet-helper@0.6.4 tuxtina.json2yaml@0.2.0
Key : PSVersion Value : 5.1.17134.137 Name : PSVersion
Key : PSEdition Value : Desktop Name : PSEdition
Key : PSCompatibleVersions Value : {1.0, 2.0, 3.0, 4.0…} Name : PSCompatibleVersions
Key : BuildVersion Value : 10.0.17134.137 Name : BuildVersion
Key : CLRVersion Value : 4.0.30319.42000 Name : CLRVersion
Key : WSManStackVersion Value : 3.0 Name : WSManStackVersion
Key : PSRemotingProtocolVersion Value : 2.3 Name : PSRemotingProtocolVersion
Key : SerializationVersion Value : 1.1.0.1 Name : SerializationVersion
Issue Description
Searched for existing issues, didn’t find anything. Others in the chat room also confirmed Reproduced with latest Insiders Build of vscode.
Steps to Reproduce:
- Install vscode
- Open a powershell script file containing working region and endregion tags
- Observe that the editor folding works
- Install Powershell Extension (ms-vscode.powershell) version 1.8.1
- Relaunch vscode
- Observe that editor folding is not working
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 3
- Comments: 22 (8 by maintainers)
Commits related to this issue
- (GH-1428) Make region code folding non-case sensitive parse whitespace Previously the code folding feature would fail to find region blocks starting with `Region` or ending with `EndRegion`. This wa... — committed to glennsarti/vscode-powershell by glennsarti 6 years ago
- (GH-1428) Make region folding case insensitive and parse whitespace correctly Previously the code folding feature would fail to find region blocks starting with `Region` or ending with `EndRegion`. ... — committed to glennsarti/vscode-powershell by glennsarti 6 years ago
- (GH-1428) Make region folding case insensitive and parse whitespace correctly Previously the code folding feature would fail to find region blocks starting with `Region` or ending with `EndRegion`. ... — committed to glennsarti/vscode-powershell by glennsarti 6 years ago
- (GH-1428) Make region folding case insensitive and parse whitespace correctly Previously the code folding feature would fail to find region blocks starting with `Region` or ending with `EndRegion`. ... — committed to glennsarti/vscode-powershell by glennsarti 6 years ago
- (GH-1428) Make region folding case insensitive and strict whitespace Previously the code folding feature would fail to find region blocks starting with `Region` or ending with `EndRegion`. This was ... — committed to glennsarti/vscode-powershell by glennsarti 6 years ago
- (GH-1428) Make region folding case insensitive and strict whitespace (#1430) Previously the code folding feature would fail to find region blocks starting with `Region` or ending with `EndRegion`. ... — committed to PowerShell/vscode-powershell by glennsarti 6 years ago
@stukey Thanks. That makes it make easier to track down what’s going on. I’ve repro’d locally and working on a fix.
I am experiencing this issue too.
Syntax folding enabled (powershell.codeFolding.enable = true):
Syntax folding disabled (powershell.codeFolding.enable = false):
I noticed the problem with version 1.8.0 of the PowerShell extension too. Also version 1.8.0 or 1.8.1 appears to have made Region Folding case-sensitive again. So even with ‘powershell.codeFolding.enable’ set to false, #Region #EndRegion sections are not folded but #region #endregion sections are folded. Prior to 1.8.0 I noticed that Region Folding became non case-sensitive (which was better).
The new syntax folder is all or nothing, i.e. when active, only the folding ranges supplied will be used. None of the vscode default ones will be used.
The vscode region folding is defined here; https://github.com/Microsoft/vscode/blob/master/extensions/powershell/language-configuration.json#L26-L31
The syntax folder uses this; https://github.com/PowerShell/vscode-powershell/blob/master/src/features/Folding.ts#L425-L426
One difference I see is casing.
However without the source document debugging/reproing this issue is almost impossible.
@msm-fc
VSCode setting;
"powershell.codeFolding.enable": "false",