Vscode: Outline: support for `//#region` fold regions

Created on 7 Jun 2018  路  7Comments  路  Source: microsoft/vscode

in conjunction with hierarchical support in outlines.

Here's how Xcode is doing it:

capture d ecran 2018-06-07 a 11 37 44

feature-request outline

Most helpful comment

@jrieken @aeschli I don't think this should be language specific. With folding providers and symbol providers, we already have both regions and which symbols they contain. If we want to support this feature, we should use these to construct the outline

All 7 comments

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

Each language support defines what document symbols it returns and these are shown in the outline.

What language do you want the feature for?

Typescript, but any way of exposing a "section" symbol from a document would work, I guess.

@jrieken @aeschli I don't think this should be language specific. With folding providers and symbol providers, we already have both regions and which symbols they contain. If we want to support this feature, we should use these to construct the outline

The purpose of document symbols is very spcifically to provide the symbols for the quick outline as well as the new outline. Why trying to be smart on our side and merge in the two providers with very specific purposes. This just asks for trouble.
The language provider knows much better what document symbols are meaningful to the user.

Also, the folding provider doesn't define a name that could be used as a symbol name, has a separate lifecycle...

Why trying to be smart on our side and merge in the two providers with very specific purposes. This just asks for trouble.

Well, you don't need to merge but you can simply add your own tree. Similar to the unit-test-navigator https://marketplace.visualstudio.com/items?itemName=roblourens.unittest-navigate. However, that should and easily can be done as extension. It's the combination of an API command and the registration of a document symbol provider. That will give you two separate trees and one flat view in the quick outline.

screen shot 2018-06-22 at 12 36 19

If you want regions/pragmas be intermixed with document symbols you need to do this per language brain/extension.

@julien-c What is it you are looking for?

Giving this back to you @mjbvz. I think this should come from language extension themselves because only then the hierarchy looks nice, e.g. not multiple root nodes per extensions/scope and only with that we are sure things are correct.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

biij5698 picture biij5698  路  3Comments

DovydasNavickas picture DovydasNavickas  路  3Comments

shanalikhan picture shanalikhan  路  3Comments

philipgiuliani picture philipgiuliani  路  3Comments

trstringer picture trstringer  路  3Comments