Skip to content

Allow YAML for all configuration files #4851

Closed

Description

JSON has a couple of issues:

  • Many things need to be escaped
  • Not human-readable very well
  • No line breaks in strings
  • No advanced features like repeating/references
  • comments are not officially supported

I propose that VS Code supports YAML aswell as JSON for all config files (settings.json, launch.json, tasks.json, snippets.json). Especially for Snippets it would be much better experience, but also for tasks etc. As YAML is a superset of JSON the current JSON schema can be mapped 1:1 to YAML.

For example, VS Code should look for a launch.json file, and if it doesn't find one, look for a setting.yaml file.

This would of course depend on IntelliSense support for YAML with JSON schemas (#1176)

Activity

  1. added
    feature-request
    on Apr 1, 2016
  2. dbaeumer commented on Apr 4, 2016

    @dbaeumer
    Member

    Chris Dias (@chrisdias) assigning to you. This is a overall product decision.

    Erich Gamma (@egamma) FYI.

  3. chrisdias commented on Apr 5, 2016

    @chrisdias
    Contributor

    Thanks for this suggestion! We've started down the path of using the json file format and I think we should continue along that path, unless we find a compelling reason to move to yaml.

    Here's the thinking. While json has shortcomings, it also has benefits:

    • There is a native parser built into the runtime and we care deeply about parsing speed. For example, we parse configuration files during startup.
    • json structures are easily described using TypeScript, which is what we write 99% of the tool in. It is "natural" to use json in TypeScript.
    • Code itself already has great json tooling (schema, IntelliSense, formatting). This does not mean we won't improve yaml support, I'm just pointing out we've already got this in place.
    • Suggesting to support both yaml and json is pragmatic but also means two code paths (bugs, bloat) and two sets of docs to maintain long term, something we would like to avoid.

    So, I think unless we have a compelling reason to move, we should stick with json for our configuration files. If we did decide to support yaml I would recommend a migration rather than a model where we support multiple file formats.

    Thanks again for the suggestion, it is always good to discuss these ideas and make sure we're doing the right things.

  4. DanStevens commented on Aug 24, 2017

    @DanStevens

    Writing multiline code snippets (e.g. Code\User\snippets\PHP.json) is a lot easier in YAML thanks to the | symbol.

  5. locked and limited conversation to collaborators on Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions