Skip to content

Add Syntax Aware Code Folder (when available) #1276

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

Closed
TravisEz13 opened this issue Apr 18, 2018 · 2 comments
Closed

Add Syntax Aware Code Folder (when available) #1276

TravisEz13 opened this issue Apr 18, 2018 · 2 comments
Labels
Area-Code Formatting Issue-Enhancement A feature request (enhancement).

Comments

@TravisEz13
Copy link
Member

from the VS Code release notes

Folding Provider API
To enable extensions to provide language aware folding ranges, a new provider API is proposed:

export namespace languages {
 /**
   * Register a folding provider.
   *
   * Multiple folding can be registered for a language. In that case providers are sorted
   * by their [score](#languages.match) and the best-matching provider is used. Failure
   * of the selected provider will cause a failure of the whole operation.
   *
   * @param selector A selector that defines the documents this provider is applicable to.
   * @param provider A folding provider.
   * @return A [disposable](#Disposable) that unregisters this provider when being disposed.
   */
 export function registerFoldingProvider(selector: DocumentSelector, provider: FoldingProvider): Disposable;
}

See the full APIs here.
The equivalent APIs are proposed here as protocol extensions to the language server protocol. Feedback is welcome!

@TylerLeonhardt
Copy link
Member

Thanks Travis! We'll be watching for this to make it to prime time for us to use.

@TylerLeonhardt
Copy link
Member

duping this to #1336

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Code Formatting Issue-Enhancement A feature request (enhancement).
Projects
None yet
Development

No branches or pull requests

2 participants