-
Notifications
You must be signed in to change notification settings - Fork 28k
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
[json] Reduce "The number of foldable regions is limited to a maximum of 5000" pop up #142496
Comments
We had issues from users that found that folding ranges were missing and understand why. But yes, I'm also not a fan of notifications with information that is not relevant to me. @jrieken What would you say, is the language indicator a better place for this? |
Yeah, that might be fair use of it. Either a message specific about folding or a more generic large file info (in case this also affect after features) |
@jasonwilliams Am I right to assume that the file you're opening when you get this message is well over 10,000 lines long? If not it shouldn't be possible to have that many foldable regions. It should be ok to increase the limit, after clicking on 'Folding Maximum Regions', to 20,000 or more. The 5,000 limit is fairly conservative. |
I started getting a Debug Terminal open when I opened the terminal. Now I'm getting this message. Are these related? |
@rebeccapeltz I can't think of a way these two things could be related. One way to find out would be to click on 'Folding Maximum Regions' in this message when it comes up, increase the limit enough that it stops coming up (try say 20,000) and see if the Debug Terminal continues to open even when this message is no longer coming up. |
I get this popup if I open a package-lock.json file, which the current one I'm looking at is 42,415 lines. I'm not going to edit it, but I was in vscode and just wanted to see the top few lines that have the file version. |
In the meantime, can this warning be removed again? It pops up very frequently. It might save some time for users who were confused by the missing folding ranges, but it wastes a lot of time for users who don't care about folding. |
@mstange Have you tried bumping that limit to 20,000? Or if you never care about folding at all then you could turn it off by opening settings ( Ctrl+, ), type "folding", and uncheck the top option there. @aeschli Also, how about bumping that default to 10,000? Or, if you don't mind reviewing some code rework to make that area faster, bump the default to 20,000 or more? |
It helps for my 60000 line plain text file, thanks. It probably won't help for the other cases where I encountered it: When I pipe long command line output into
I care about code folding in code. But I also use VS Code on files that are not code: Plain text files and logs. Especially logs are the ones that are likely to be very big. I don't need code folding in those files. |
Agree with others in needing a better justification for constantly notifying me of this condition. To that end would be nice to understand why and where this is happening. Within an admittedly large project I don't recall more than a handful of folds I've created, though I do have a few external components so knowing where would be really helpful. |
@MattGrdinic This is happening because a "folding range provider" is returning a large number of foldable regions. Those are marked with the downward chevron (like a wide "v") in the margin just left of the text when you hover the cursor there. If you have one or more extensions which provide folding ranges for a particular language then that's where they are coming from. Some of those are built-in, e.g. for Typescript. If there's no extension present which provides folding ranges for a language then they're coming from the default indent-based provider. That provider creates a foldable range at every line in the source where the next line has a larger indent. You can disable folding range provider(s) for a particular language or all languages via "editor folding" in vscode settings. @aeschli Do you think this issue could be resolved by changing that message, about too many folding regions, to be an information level message in the problems panel? I've looked around for how to use that panel in vscode and haven't figured it out yet. If you'd like it moved there a pointer on how to do it would help. |
@PieterBranderhorst Agree that the notification is too prominent. The idea is to use the language indicator instead: |
@aeschli I was thinking more of adding a message in the problems panel: |
@PieterBranderhorst We currently use the problems view only for resource based diagnostics, so I don't think we should put it there. |
PMJI with a solution - I found this thread specifically with a search for this new issue... Exactly as noted by @mstange - I'm getting this in a project where I'm looking at huge .log files. I see "[log]": {
"editor.foldingMaximumRegions": 11,
"something.else": value
},
"[php]": {
"editor.foldingMaximumRegions": 22,
"unrelated.setting": value
} If you set two languages like that you'll see the warnings change with the correct maximum. However, click on the warning where it offers to change the config, and the setting gets saved outside of the scope of the language. So you don't get the above, you get something like this: // attempt to evade the nag
"editor.foldingMaximumRegions": 40000,
"[log]": {
"something.else": value
},
"[php]": {
"unrelated.setting": value
} That's a new issue for a different ticket. What's relevant here is that there is another setting "[log]": {
// no need to set max regions
"editor.folding": false,
},
"[php]": {
// be sure folding is active for this language
"editor.folding": true,
// reasonable warning trigger
"editor.foldingMaximumRegions": 10000,
},
// increase warning default above 5000 for all languages except as specified
"editor.foldingMaximumRegions": 30000, With this, the warning serves the intended purpose, and doesn't get triggered outside of that scope. HTH |
* reduce number of json notifications * use language indicator for folding limit warnings. For #142496 * add comment for resultLimit + 1
I pushed a change. We're now using the language indicator to inform about limited folding, outline and color symbols. No more notifications. |
Thank you! |
Does this issue occur when all extensions are disabled?: Yes
https://code.visualstudio.com/updates/v1_64#_editor-folding-limit
Since updating to version 1.64 I'm getting notifications constantly about folded regions. The files I have open are not that big so I don't know why this is coming up or what it wants me to do. 5000 is already a lot so I don't need to increase it.
VSCode has enough pop-ups as it is and this is just adding to the noise. What is the call-to-action here? I find it confusing and I'm not sure why its asking me to increase the foldable regions.
The text was updated successfully, but these errors were encountered: