-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code folding not always correct #1631
Comments
In https://raw.githubusercontent.com/poshbotio/PoshBot/master/PoshBot/Implementations/Teams/TeamsBackend.ps1 Line 140 folds strangely. It goes to 169 not 450 |
Okay so found the problem. The token matching is broken. It looks for In the use case above the following code snippet is confusing the folder; Bad folder foreach ($1 in $2) { <----- STARTS MATCH HERE (1)
$x = @{ <----- STARTS MATCH HERE (2)
'abc' = 'def'
} <----- ENDS MATCH HERE (1) (2)
} Good folder foreach ($1 in $2) { <----- STARTS MATCH HERE (1)
$x = @{ <----- STARTS MATCH HERE (2)
'abc' = 'def'
} <----- ENDS MATCH HERE (2)
} <----- ENDS MATCH HERE (1) The old grammar based folder knew the difference between a Note I found this is also the case for |
I have a workaround just need to add tests because obviously this was missed. |
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. |
System Details
System Details Output
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.
The text was updated successfully, but these errors were encountered: