Update coffee-fmt to v0.10.2 and beautify internal source code

This commit is contained in:
Glavin Wiechert 2015-05-19 09:40:59 -03:00
parent 94fc870b84
commit 5fd07cff9c
15 changed files with 1228 additions and 1226 deletions

View File

@ -1,5 +1,5 @@
{
"indent_size": 2,
"indent_size": 4,
"indent_char": " ",
"indent_level": 0,
"indent_with_tabs": false,

View File

@ -53,7 +53,7 @@
"atom-message-panel": "^1.2.4",
"atom-space-pen-views": "^2.0.5",
"bluebird": "^2.9.25",
"coffee-fmt": "0.7.0",
"coffee-fmt": "0.10.2",
"coffee-formatter": "^0.1.2",
"csscomb": "^3.0.4",
"diff": "^1.4.0",

View File

@ -290,7 +290,7 @@ module.exports = class Beautifiers
beautify : (text, allOptions, grammar, filePath, {onSave} = {}) ->
return new Promise((resolve, reject)=>
logger.info('beautify', text, allOptions, grammar, filePath)
console.log(allOptions)
# Get language
fileExtension = path.extname(filePath)
@ -341,6 +341,7 @@ module.exports = class Beautifiers
# Options for Language
options = @getOptions(language.namespace, allOptions) or {}
console.log(options)
# Support fallback for options
if language.fallback?
@ -353,7 +354,7 @@ module.exports = class Beautifiers
logger.verbose(grammar, language)
beautifiers = @getBeautifiers(language.name, options)
console.log(options)
# logger.verbose('beautifiers', beautifiers)
#
# Check if unsupported language
@ -545,6 +546,7 @@ module.exports = class Beautifiers
envs = @getUserHome()
home = path.normalize(path.join(envs, config))
proj = @findFile(config, dir, upwards)
console.log(dir, proj, home)
return proj if proj
return home if @verifyExists(home)
null
@ -601,13 +603,13 @@ module.exports = class Beautifiers
externalOptions = JSON.parse(strip(contents))
catch e
# logger.verbose "Failed parsing config as JSON: " + configPath
logger.debug "Failed parsing config as JSON: " + configPath
# Attempt as YAML
try
yaml ?= require("yaml-front-matter")
externalOptions = yaml.safeLoad(contents)
catch e
logger.verbose "Failed parsing config as YAML and JSON: " + configPath
logger.debug "Failed parsing config as YAML and JSON: " + configPath
externalOptions = {}
else
externalOptions = {}