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

Preserve cson formatting, order and quoting.  #25

@p0lm

Description

@p0lm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions