PowerShell Extension breaks Standard VSCode comment line code folding for .ps1
and .psm1
files
#4745
Open
5 of 6 tasks
Labels
Prerequisites
Summary
In VSCode you can fold entire blocks of code that are indented under a commented out line. I use this everywhere in other languages to organise my code, in PowerShell this simply does not work.
Today, I set out to find out why. Turns out the PowerShell extension is interfering, In the following example, only the PowerShell extension is enabled (you can see on the right, all other extensions are greyed out, I made sure to reload after).
At the start, I cannot fold any of the functions under their respective commented out lines, the code folding arrow for the commented out lines will not even show in the gutter.
When I disable the PowerShell extension and reload the window, I can fold both functions under their respective commented out lines.
Trying various configurations of
"powershell.codeFolding.enable": false
and"powershell.codeFolding.showLastLine": false
, did not solve the issue. I am not sure what these lines are for but I did try varioustrue
/false
settings, did not work.PowerShell Version
Visual Studio Code Version
Extension Version
v2023.6.0
Steps to Reproduce
With the Powershell extension enabled try to fold the function under their respective commented out lines:
Then disable the extension, reload the window and try the same thing again with the above code, it should work this time around.
Visuals
No response
Logs
No response
The text was updated successfully, but these errors were encountered: