season
season copied to clipboard
Preserve cson formatting, order and quoting.
I stumbled upon https://github.com/atom/atom/issues/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