-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
[folding] Show number of lines folded #130250
Comments
(Experimental duplicate detection)
|
Thanks bot, but none of the recommendations are like mine. |
Also related: #124177 |
Just a small suggestion now that we hit the votes 🙂 Instead of "number of lines", I think it would be great if it said "number of items". For example: "CloudWatchMetrics": [
{
"Namespace": "test",
"Dimensions": [
[
"process.pid",
"process.executable.name",
"process.executable.path",
"process.command",
"process.command_line"
]
],
"Metrics": [
{
"Name": "process.memory.physical_usage",
"Unit": "Bytes"
},
{
"Name": "process.memory.virtual_usage",
"Unit": "Bytes"
}
]
}
], would become "CloudWatchMetrics": [
{ ...(1 item)...
}
], Especially since you can already see the # of lines in the sidebar: |
@aeschli Can I start on this issue? |
@aeschli I think this issue is better suited for an extension. What do you think? |
I don't think this can be done in an extension as there's no API to access all folded regions. |
So I remembered I had given this a go a while ago, except it didn't work properly: The decoration wouldn't update in real-time until you edited the document, and it would randomly freeze VS Code when you clicked fold/unfold too often. But if someone wants to pick it up, my WIP code changes are in this commit: 67c4de2 |
Giving this a try. |
Hmm, @jzyrobert 's WIP commit doesn't seem to want to work (at least, on my end) when I apply the contents to a new fork from December of Also, sometimes removing sections of content between brackets or close then reopening a file crashes the editor very badly... I'll look into these issues some more in a few days but anyone please feel free to work on this as well. |
Hey everyone, I managed to make an extension that solves this problem along with other many requested folding-related issues. You can find it here: https://marketplace.visualstudio.com/items?itemName=MohammadBaqer.better-folding A demo of the extension in action: Screen.Recording.2023-01-23.at.12.14.58.mov |
I've wanted to comment this on #124177 but since it's closed and this issue is mentioned on it I'm sharing here: in case anyone needs this for viewing JSON files in vscode and wants to see how many keys there are in an object (like with codemirror/insomnia): https://marketplace.visualstudio.com/items?itemName=ZainChen.json |
Current when a block is folded it currently only show ellipses, which I think it could be improved by show the lines of code in the block.
e.g. (using Python as an example)
When the code above is folded, it is represented as:
Instead of just "...", it would be very useful to display how many lines are folded.
With short block it is not too difficult to identify the number lines folded by looking at the line number, but for a larger blocks, it would aid significantly by showing the number of line folded.
The text was updated successfully, but these errors were encountered: