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

[All] Re-enable indentation based folding #3617

Closed

Conversation

deathaxe
Copy link
Collaborator

@deathaxe deathaxe commented Dec 8, 2022

This commit re-enables indentation based folding for all syntaxes which have not yet been covered by other PRs.

Syntax based folding doesn't cover all possible use cases and therefore shouldn't be the only one.

Related with #3568, #3601

This commit re-enables indentation based folding for all syntaxes which
have not yet been covered by other PRs.
@BenjaminSchaaf
Copy link
Member

I don't think this is generally a good idea as with syntaxes like D, rust and especially lisp I'd expect most users of code folding to prefer only scope-based folding.

@deathaxe
Copy link
Collaborator Author

Maybe Lisp is simple enough to restrict it to syntax based folding, but several other syntaxes

  1. don't provide consistent meta.[group|block|...] scopes under all circumstances to distinguish fold regions reliably (e.g. expressions like ( code ( code )) ).

  2. don't provide rules to fold statements like switch case

In D the case blocks are currently not foldable as those rely on indentation folding.

switch (a) {

   case 0:
      // not foldable code
      break;

   case 1:
      // not foldablecode
      break;
}

IMHO, both indentation strategies live good enough next to each other to be enabled at the same time by default.

@deathaxe deathaxe closed this Dec 15, 2022
@deathaxe deathaxe deleted the pr/re-enable-indentationfolding branch December 15, 2022 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants