-
Notifications
You must be signed in to change notification settings - Fork 295
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
More code folding issues #4982
Comments
The folding range for the function call ( Not sure if it might be related to dart-lang/sdk@604bf2f which avoids two folding ranges ending on the same line because VS Code doesn't handle them. I would expect that would only reduce the range by a single line though, and this looks way off. |
Ok, so this is caused by the change above. It's working as it was intended to, but it does result in this behaviour. The issue is that VS Code only does "line folding", it will ignore the characters we provide. It will not allow any folding ranges to intersect or start/end on the same lines. So given this code: f(
'string',
() {
}); We will try to produce two ranges (one around all of the arguments, and one for the body of the function). Since they end on the same line, we chop the first one and make it end before the second one starts. I don't think we have any good options here. We could:
I suspect in this case (3) might be slightly better, but I don't think that's always the case. Let's leave this open to collect feedback and if this kind of code is common we could try the other way (or do do something smarter). |
I think that makes total sense. |
I'm not sure I understand this - in both (1) and (3) the starts of the ranges should not change, only the ends. I'm not sure where the closure fold is starting in the wrong place. |
Sorry, I got confused. I assume this is mainly impacting tests. |
A less specific scenario would be: test(
'Hello '
'World', () {
print('foo');
}); |
This is a follow-up to #4121
Consider the following code:
Collapsing
testSource
leads to:Screen.Recording.2024-02-11.at.09.17.05.mov
The text was updated successfully, but these errors were encountered: