Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Preserve cson formatting, order and quoting. #25

Open
p0lm opened this issue Jun 13, 2018 · 0 comments
Open

Preserve cson formatting, order and quoting. #25

p0lm opened this issue Jun 13, 2018 · 0 comments

Comments

@p0lm
Copy link

p0lm commented Jun 13, 2018

I stumbled upon atom/atom#7763 when looking for an existing issue on this. It seems like the original issue never got to be recreated here, so I would like to do after all.

As season is used by atom for parsing of and writing to config.cson, this means no formatting is preserved after safe. Over time I've hacked on my config quite a lot, and I would really like to add some comments and whitespace here and there to provide some readability.

Example (taken from original issue):

Edited config.cson:

#
# Config
#

'*':
    # --- MAIN ---

    # WELCOME
    welcome:
        showOnStartup: false

    # CORE
    core:
        disabledPackages: [
            'autocomplete-plus'
            'wrap-guide'
        ]
        themes: [
            'one-dark-ui'
            'solarized-dark-syntax'
        ]

    # EDITOR
    editor:
        invisibles: {}
        tabLength: 4


    # --- PACKAGES ---

    # REPORTING
    'exception-reporting':
        userId: 'ddaafd07-dffd-b252-48db-612909a97759'

    # BRACKET MATCHER
    'bracket-matcher':
        autocompleteBrackets: false
        autocompleteSmartQuotes: false

    # WHITESPACE
    whitespace:
        ensureSingleTrailingNewline: false

After saving:

"*":
  welcome:
    showOnStartup: false
  core:
    disabledPackages: [
      "autocomplete-plus"
      "wrap-guide"
    ]
    themes: [
      "one-dark-ui"
      "solarized-dark-syntax"
    ]
  editor:
    invisibles: {}
    tabLength: 4
  "exception-reporting":
    userId: "ddaafd07-dffd-b252-48db-612909a97759"
  "bracket-matcher":
    autocompleteBrackets: false
    autocompleteSmartQuotes: false
  whitespace:
    ensureSingleTrailingNewline: false
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant