Skip to content
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

Add folding from end of region #77363

Closed
wants to merge 2 commits into from
Closed

Conversation

zbecknell
Copy link

This is a simple to understand enhancement: allow folding code from the end of a region. A gif is worth a thousand words, so here's what it looks like in action:

Fold From End 1

High-level details on the implementation:

  • Disabled by default
  • When region ends intersect, the outer-most region is collapsed on click
  • As you can see I chose to de-emphasize the end fold icon a bit

I hope you will consider pulling in this change, as I quite like being able to fold up a large region when I'm at its end to give a better idea of context around it. If you don't want to implement this or some form of it, I've at least enjoyed playing around in the code a bit. It was a nice night of fun.

@msftclas
Copy link

msftclas commented Jul 14, 2019

CLA assistant check
All CLA requirements met.

@zbecknell zbecknell changed the title Enhancement: Fold from end of region Add folding from end of region Jul 14, 2019
@FastestMolasses
Copy link

I really like this idea, I hope it's implemented.

Copy link
Contributor

@aeschli aeschli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff.
I want to talk to @alexandrudima if we find a possibility to do this with a single decoration

src/vs/editor/contrib/folding/foldingModel.ts Show resolved Hide resolved
src/vs/editor/common/config/commonEditorConfig.ts Outdated Show resolved Hide resolved
src/vs/editor/contrib/folding/foldingModel.ts Outdated Show resolved Hide resolved
@ilayofir
Copy link

It would also be nice to be able to fold from the bottom at the explorer window, since directories like node_modules might get very big

@aeschli aeschli added editor-folding Editor code folding issues feature-request Request for new features or functionality labels Oct 24, 2019
@aeschli aeschli added this to the Backlog milestone Oct 24, 2019
@joaomoreno joaomoreno changed the base branch from master to main February 15, 2021 08:51
@seelts
Copy link

seelts commented Aug 10, 2022

2022...

@1muen
Copy link

1muen commented Sep 7, 2022

@ilayofir

It would also be nice to be able to fold from the bottom at the explorer window, since directories like node_modules might get very big

If the node_modules folder opens because I clicked on Show Definition on a module, I close the large node_modules folder structure by clicking on any file or folder in there and press the left arrow key, so the tree structure shrinks.

@adrm
Copy link

adrm commented Oct 16, 2022

Could this be at least shipped as an extension? I understand the team might have its doubts about how to implement this in a consistent manner, but it will be useful immediately if it can be used as an extension.

@WayneWuQSR
Copy link

This is a feature I'm after now. Is there any development on this? Or is there any extension can do the same thing?

@zbecknell
Copy link
Author

This PR is of course old as the hills now and probably needs to be almost entirely rewritten (just an assumption). If there is a desire from maintainers to really include this I could crack the code back open and try to update it with the latest codebase.

@KaKi87
Copy link

KaKi87 commented Apr 22, 2024

Hi,

If there is a desire from maintainers to really include this

Since it doesn't look like this is going to happen, would you consider checking whether this would be doable as an extension, and if yes, would you consider building it as one instead ?

Thanks

@aeschli
Copy link
Contributor

aeschli commented Dec 12, 2024

Closing the PR as there hasn't been any progress for multiple years. It's easier to start with a fresh PR.

If someone is interested, I would suggest to check out:

firstLineDecorationClassName?: string | null;

This is used to render the folding indicator.

I would suggest adding a lastLineDecorationClassName that can be used for the end indicator.

@aeschli aeschli closed this Dec 12, 2024
@KaKi87
Copy link

KaKi87 commented Dec 12, 2024

😭

@zbecknell
Copy link
Author

The end of an era 🤓

@KaKi87
Copy link

KaKi87 commented Dec 12, 2024

VSCode needs a fork that is community-centered.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editor-folding Editor code folding issues feature-request Request for new features or functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants