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

[folding] show folding lines #19690

Open
g5codyswartz opened this issue Feb 1, 2017 · 6 comments
Open

[folding] show folding lines #19690

g5codyswartz opened this issue Feb 1, 2017 · 6 comments
Assignees
Labels
editor-folding Editor code folding issues feature-request Request for new features or functionality
Milestone

Comments

@g5codyswartz
Copy link

g5codyswartz commented Feb 1, 2017

I would like to see more options with code folding and with bracket matching.
It seems the user base is quite split on how they want the collapsed region to display, so I think this should be a user configuration setting along with the other features listed.

Feature Requests

  1. Collapse fold to a single line Related#2 Alternative Designs#1
  2. Bracket anchors/leads/lines seen in pictures #2 and #3 + Related#2 Alternative Designs#2
  3. Peek at top bracket when hovering the bottom bracket pictures #3 This should only happen when the top matching bracket isn't visible on the current viewport.
  4. Highlight current region. In pictures #1 and #2 it highlights the current block you're on
  5. Collapse block from bottom bracket. In pictures #1 and #3 you can collapse a block region from the lower bracket which can be really nice, it can be a quick way to see what the bracket belongs to w/o feature request #3

Picture examples

  1. Single line collapse
    image
  2. Anchor / leads / lines
    image
  3. Peek at top bracket
    image

Related

  1. Collapse to same line [folding] Collapse ending brace to the same line #3352
  2. Icons for folding Icons for folding and unfolding #2948

Labels

  • editor
  • editor-folding
  • feature-request
@aeschli aeschli added editor-folding Editor code folding issues feature-request Request for new features or functionality labels Feb 2, 2017
@aeschli aeschli added this to the Backlog milestone Feb 2, 2017
@aeschli
Copy link
Contributor

aeschli commented Feb 2, 2017

@g5codyswartz Thanks Cody for the nice writeup. There are no easy fixes here, so I can't give any estimate if and when we would tackle any of these.
The peek at the top doesn't necessarily be related with folding but rather with bracket matching @alexandrudima FIY.

@dawesi
Copy link

dawesi commented Jun 4, 2018

Here's another popular one used for decades, seen this on hundreds of projects:

public string function foo() {
        if ( one ===  1 ) {
            anotherone = 2;
            } 
    }

Would have created a screenshot but on win10 vscode goes black when you do that. #bug

It would be great if the dev team cared about standards that have been around for 20 years and still exist in billions of lines of code. To not implement this means the core team have a narrow-minded view of their audience.

Core features like this are critcal to developers and VS code currently wastes millions of hours of devs time because this feature is half-thought out and implemented. This is core editor functionality.

Please get a bunch of heads around this. Surely someone has access to the VSEnt guys and how they did it? Dreamweaver (#sigh) probably had the best implementation of customizing this using a visual code block you could format yourself and it learnt what you wanted.

@aeschli
Copy link
Contributor

aeschli commented Jun 4, 2018

@dawesi Not sure how your code sample is related to this issue.
This issue is about the presentation of code folding ranges and actions.
How the actual code ranges are computed (from where to where) depends on each language. In VSCode most laguages create folding ranges based on indentations, but it's also possible to do it based on the syntax. TypeScript and JavaScript do that now.

Can you create a new issue with your sample, what language mode this is for, what you see and what you expect. Thanks a lot!

@aeschli aeschli changed the title [Folding] Additional Code Folding, Bracket / Brace, and Block Options [folding] show folding lines with open and close action Sep 21, 2018
@aeschli aeschli changed the title [folding] show folding lines with open and close action [folding] show folding lines with open and close actions Sep 21, 2018
@aeschli
Copy link
Contributor

aeschli commented Sep 21, 2018

fold to single line is #3352

@waldyrious
Copy link
Contributor

waldyrious commented Jul 23, 2019

An alternative to decorating the gutter could be to highlight the lines in the block that would be folded, when its corresponding folding icon is hovered. It could be something in a similar style to the current line highlight. (Somewhat related: #73800).

@aeschli aeschli closed this as completed Oct 9, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 25, 2019
@aeschli aeschli reopened this Dec 31, 2021
@aeschli aeschli changed the title [folding] show folding lines with open and close actions [folding] show folding lines Dec 31, 2021
@aeschli
Copy link
Contributor

aeschli commented Dec 31, 2021

#139425 also suggests to highlighting the active fold region with a different color.

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

No branches or pull requests

4 participants