You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
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.
Activity
dbaeumer commentedon Apr 4, 2016
Chris Dias (@chrisdias) assigning to you. This is a overall product decision.
Erich Gamma (@egamma) FYI.
chrisdias commentedon Apr 5, 2016
Thanks for this suggestion! We've started down the path of using the
jsonfile format and I think we should continue along that path, unless we find a compelling reason to move toyaml.Here's the thinking. While
jsonhas shortcomings, it also has benefits:jsonstructures are easily described using TypeScript, which is what we write 99% of the tool in. It is "natural" to usejsonin TypeScript.jsontooling (schema, IntelliSense, formatting). This does not mean we won't improveyamlsupport, I'm just pointing out we've already got this in place.yamlandjsonis 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
jsonfor our configuration files. If we did decide to supportyamlI 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.
DanStevens commentedon Aug 24, 2017
Writing multiline code snippets (e.g. Code\User\snippets\PHP.json) is a lot easier in YAML thanks to the | symbol.