alefragnani / vscode-separators

Separators Extension for Visual Studio Code
GNU General Public License v3.0
40 stars 6 forks source link

[FEATURE] - Add Support for "Type" symbols #23

Open colelawrence opened 3 years ago

colelawrence commented 3 years ago

In many places such as in the case of discriminated unions, we use types as a top-level concept. It would be very helpful to include those boundaries in the separators.

image

You can see from this screenshot, that types are reported to the outline view, so it might be relatively easy to add this feature.

alefragnani commented 3 years ago

Hi @colelawrence ,

I understand your request and I agree it would be a great improvement, but unfortunately VS Code doesn't recognize InputDefinition as a Type.

If you use the Command Palette an run the Go to Symbols command, and type :, it will group the symbols by its kind. When you find the InputDefinition symbol you will notice it doesn't belong to a Type group, but Variables instead. VS Code has a set of kinds its support (https://code.visualstudio.com/api/references/vscode-api#SymbolKind) and Types is not one of them.

So, unless VS Code expands its symbol kinds to have a Type kind, there is no way to identify when a Type is found.

Hope this helps