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 comment first line for folded sections #31966

Open
lalmat opened this issue Aug 3, 2017 · 6 comments
Open

[folding] show comment first line for folded sections #31966

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

Comments

@lalmat
Copy link

lalmat commented Aug 3, 2017

I think it could be really useful to change the multiline comment folding.

When you fold a comment like this (like above php function) :

/**
 * Print person name on terminal
 *
 * @param person $p
 * @return void
 */

You see this :

/** ...

In some editors like phpStorm or Eclipse, it's folded like this :

* Print person name on terminal ...

That's very more useful ;)

Is it possible to implement this kind of folding ?

@vscodebot vscodebot bot added editor editor-folding Editor code folding issues labels Aug 3, 2017
@rebornix rebornix assigned aeschli and unassigned rebornix Aug 3, 2017
@aeschli aeschli changed the title [Folding] Multiline comments before function should show line 1 instead of 0 when folded. [folding] show comment first line for folded sections Aug 4, 2017
@aeschli aeschli added the feature-request Request for new features or functionality label Aug 4, 2017
@aeschli aeschli added this to the Backlog milestone Aug 4, 2017
@aeschli
Copy link
Contributor

aeschli commented Aug 4, 2017

This is not easy to implement with the current approach that we picked. The main reason is that our folding strategy is based on indentation only and doesn't have an understanding of what it folds (comments, blocks...). To do what you suggest it would need to have a language understanding in order to know that the folded content starts with a comment and to use the first line of the comment. Just showing the 2nd line instead of the first will not work in all cases.

We have #3422 for adding language agnostic folding which is a prerequisite

@aeschli
Copy link
Contributor

aeschli commented Oct 9, 2019

Depends on #70794

@gorn
Copy link

gorn commented Mar 30, 2021

Language agnostic folding has been implemented, so this can be implemented as well now.

@lalmat
Copy link
Author

lalmat commented Mar 31, 2021

Yes !! Good news ! Thank you.

@abhishekmadhu
Copy link

abhishekmadhu commented Apr 28, 2022

Is someone working on a PR?
If not, I would like to try my hands on this. Will this be a good first issue for the repository?

@aeschli?

@aeschli
Copy link
Contributor

aeschli commented Apr 28, 2022

@abhishekmadhu I'm not aware of anyone working on it. But it's quite a complex issue. Happy to give you more details.

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

No branches or pull requests

6 participants