vscode-yaml
vscode-yaml copied to clipboard
Add Custom Region Support to Yaml Files
Is your enhancement related to a problem? Please describe.
At times there are areas of a yaml file (like a block of anchor definitions) that take up a large portion of the file, and while they may not be under a top level key, a user would like to fold them so as to more easily read and navigate the yaml file.
Describe the solution you would like
Currently, with JS in vscode, you can add a comment such as // #region
and // #endregion
to support this. Currently yaml in vscode does not support this type of functionality, and that comment key is not valid in yaml.
Something like # !region
or the like so we could have this functionality in a yaml file would be really nice
Describe alternatives you have considered
There aren't really any alternatives to this, as some things you'd like a custom region for are top down, and as such, you can't put at say, the bottom of the file.
Although YAML isn't mentioned in the VS Code documentation, this behavior seems to be baked into the editor by default, including the keybindings. This works if this extension is disabled, so unfortunately it seems like this extension is preventing this from working.
i wholly support this request, because I now split my yaml files for readability.
Usually for languages where #
starts a comment, the syntax used by vscode is #region [...]
and #endregion
. No need for extra characters like in # !region
.
That doesn’t work with yml files @fholzer . I attempted that as well
Right. Neither does it for me. I was just suggesting to use that specific syntax, if it was added to this extension.