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

Code Folding #50

Open
angelozerr opened this issue Mar 8, 2017 · 12 comments
Open

Code Folding #50

angelozerr opened this issue Mar 8, 2017 · 12 comments

Comments

@angelozerr
Copy link
Contributor

angelozerr commented Mar 8, 2017

TextMate grammar can define folding https://manual.macromates.com/en/navigation_overview

It should be cool if tm4e could provide the org.eclipse.tm4e.ui.folding.TMFoldingStrategy which supports this feature.

@angelozerr angelozerr changed the title CodeFolding Code Folding Mar 8, 2017
@mickaelistria
Copy link
Contributor

Do you have an estimation of the ratio of textmate grammars that do enable folding? does VSCode rely on it ?

@angelozerr
Copy link
Contributor Author

Do you have an estimation of the ratio of textmate grammars that do enable folding? does VSCode rely on it ?

To be honnest with you, I don't remember. I must study again that but I'm very busy for the moment with JDT Codelens (an another project/topic).

@angelozerr
Copy link
Contributor Author

@micktaelistria the only thing that I can tell you is that VSCode uses by default the indent folding strategy that I have implemented for Eclipse https://github.com/angelozerr/typescript.java/blob/master/eclipse/ts.eclipse.ide.ui/src/ts/eclipse/ide/ui/folding/IndentFoldingStrategy.java

Inside VSCode TypeScript, JSON, etc editor uses this folding strategy. I know you are working on folding feature for Generic Editor. IMHO, I think Generic Editor should use this indent folding strategy by default.

@mickaelistria
Copy link
Contributor

mickaelistria commented Aug 8, 2017 via email

@angelozerr
Copy link
Contributor Author

Can you
please open an enhancement request for that?

This bug exists https://bugs.eclipse.org/bugs/show_bug.cgi?id=512956

@mickaelistria
Copy link
Contributor

This bug exists https://bugs.eclipse.org/bugs/show_bug.cgi?id=512956

That bug is about providing the extension-point, not about providing some (default) implementation.

@angelozerr
Copy link
Contributor Author

That bug is about providing the extension-point, not about providing some (default) implementation.

Done https://bugs.eclipse.org/bugs/show_bug.cgi?id=520659

@bartoszbinda
Copy link

Was it implemented in tm4e? How can I use it in generic editor to fold/unfold yaml or json?

@angelozerr
Copy link
Contributor Author

Today tm4e doesn't support code folding, but I tell me if it's a good idea since LSP4E supports now folding. For instance json language server supports folding. For yaml, I don't know.

@norru
Copy link

norru commented Jul 16, 2019

What's the status of this?

@mickaelistria
Copy link
Contributor

Still open, looking for volunteers to fix it.
But as @angelozerr mentions, LSP4E now supports folding, so there is less value in using TM4E for that.

@sebthom
Copy link
Member

sebthom commented May 12, 2022

It looks like some kind of folding now happens even without LSP, but it seems to be broken.

For toml only two sections are marked as foldable:
image

For a cpp file the wrong lines are folded:
screen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants