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

Allow languages to define multiple folding.markers #37319

Closed
mjbvz opened this issue Oct 31, 2017 · 3 comments
Closed

Allow languages to define multiple folding.markers #37319

mjbvz opened this issue Oct 31, 2017 · 3 comments
Assignees

Comments

@mjbvz
Copy link
Collaborator

mjbvz commented Oct 31, 2017

It seems that languages can currently only define a single folder.marker. I'd like to be able to define two or more of these if possible. For example, in some languages it would make sense to support both comment and #pragma regions.

Probably falls under the scope of #3422

@aeschli
Copy link
Contributor

aeschli commented Oct 31, 2017

You can define multiple pattern like here

@mjbvz
Copy link
Collaborator Author

mjbvz commented Oct 31, 2017

Makes sense. One case I was also thinking about was how you could use this to define markdown heading foldings. I imagine this would use a bunch of rules like:

// h1 folding
{
   start: #\s*\w+,
   end: #{1}\s*\w+
}

h2 folding
{
   start: ##\s*\w+,
   end: #{1,2}\s*\w+
}

...

to ensure each heading level would consume all subheadings

@aeschli
Copy link
Contributor

aeschli commented Nov 1, 2017

IMO that's better done through language aware folding. Regexes have their limitations and can get very expensive.
Closing as dup of #3422

@aeschli aeschli closed this as completed Nov 1, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants