Code folding not always correct
See original GitHub issueSystem Details
System Details Output
### VSCode version: 1.29.1 bc24f98b5f70467bc689abf41cc5550ca637088e x64
### VSCode extensions:
CoenraadS.bracket-pair-colorizer@1.0.61
DavidAnson.vscode-markdownlint@0.21.0
eamodio.gitlens@9.0.2
EditorConfig.EditorConfig@0.12.5
eg2.tslint@1.0.40
Equinusocio.vsc-material-theme@2.6.2
kisstkondoros.vscode-codemetrics@1.17.4
ms-vscode.csharp@1.17.1
ms-vscode.PowerShell@1.10.0
wesbos.theme-cobalt2@2.1.6
### PSES version: 1.10.0.0
### PowerShell version:
Name Value
---- -----
PSVersion 5.1.17763.134
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.17763.134
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
Issue Description
I am experiencing a problem with code folding. The SendMessage functions within the PoshBot Backends for slack and teams both fold rather weirdly.
Raw files: https://raw.githubusercontent.com/poshbotio/PoshBot/master/PoshBot/Implementations/Teams/TeamsBackend.ps1 https://raw.githubusercontent.com/poshbotio/PoshBot/master/PoshBot/Implementations/Slack/SlackBackend.ps1
Expected Behaviour
It should fold the entire function.
Actual Behaviour
It folds parts of the function.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:5 (3 by maintainers)
Top Results From Across the Web
The Problem With Code Folding - Coding Horror
Folding is used to mask excessive length. The presence of folded code can lull developers into a false sense of what clean code...
Read more >Code folding not working properly in certain circumstances
Describe the bug At least in top-level functions, code folding can sometimes be unavailable. For example, I might be able to fold a...
Read more >Code folding not working - Visual Studio Feedback
ALT+SHIT+COMMAND+(Up Arrow, Down Arrow) is not folding any code… I try to replace the binding for some other key combination but it didnt...
Read more >Visual Studio code folding not working properly - Stack Overflow
Try that piece of code somewhere else (to discard a more general issue). Does it happen anywhere else? If it does, it could...
Read more >Code Folding | IntelliJ IDEA Documentation - JetBrains
Select the code fragments which should be folded by default, that is, when a file is first opened in the editor. ... Custom...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Seems to work fine now, both the examples in original issue descriptions folds as expected.
Tested on VSCode 1.44.1 with Powershell extension 2020.3.0.
Folding this
test.ps1
file is also horrible. It might be the same issue:Fully folded it looks like this:
Currently on code-insiders version: Version: 1.30.0-insider (user setup) Commit: 241923763dbeaf3b64443187e935d55b29f6125d Date: 2018-12-07T22:31:41.479Z Electron: 2.0.12 Chrome: 61.0.3163.100 Node.js: 8.9.3 V8: 6.1.534.41 OS: Windows_NT x64 6.2.9200
With extension
PowerShell 1.10.1