adobe / brackets

An open source code editor for the web, written in JavaScript, HTML and CSS.
http://brackets.io
MIT License
33.26k stars 7.64k forks source link

Preferences (brackets.json) don't support comments, although defaultPreferences do #13008

Open ripper234 opened 7 years ago

ripper234 commented 7 years ago

Description

I'm trying to modify the preferences for Beautify plugin. The defaultPreferences.json file contains comments:

// Beautifier-Language-Mapping, see https://github.com/brackets-beautify/brackets-beautify#configure-languages
    "bb.beautify.languages": {
        // Default: css
        "css": "css",

        // Default: html
        "ejs": "html",
...

When copy pasting the content of "bb.beautify.languages" into brackets.json in order to modify it, I get

image

This error is resolved when stripping the // comments from the json.

The default file and running file should either both not support comments, or preferably should both support comments.

Versions

Running Release 1.8 build 1.8.0-17108 (alf_localization_release_1.8 3af64fae4) build timestamp: Wed Nov 02 2016 12:07:29 GMT+0000

on Windows.

petetnt commented 7 years ago

Using http://hjson.org/ instead of plain JSON would be one option.

ripper234 commented 7 years ago

+1, cool didn't know hjson exists

On Dec 28, 2016 00:38, "Pete Nykänen" notifications@github.com wrote:

Using http://hjson.org/ instead of plain JSON would be one option.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/adobe/brackets/issues/13008#issuecomment-269392781, or mute the thread https://github.com/notifications/unsubscribe-auth/AAKg-k_8YeFW12NL5E3JvoP8bHA1ymkxks5rMZNrgaJpZM4LV8mK .