mirror of
https://github.com/atom/atom.git
synced 2026-02-18 02:21:43 -05:00
Rename readObject() to readObjectSync()
This commit is contained in:
@@ -92,7 +92,7 @@ class AtomPackage extends Package
|
||||
@scopedProperties = []
|
||||
scopedPropertiessDirPath = path.join(@path, 'scoped-properties')
|
||||
for scopedPropertiesPath in fsUtils.listSync(scopedPropertiessDirPath, ['.json', '.cson'])
|
||||
for selector, properties of fsUtils.readObject(scopedPropertiesPath)
|
||||
for selector, properties of fsUtils.readObjectSync(scopedPropertiesPath)
|
||||
@scopedProperties.push([scopedPropertiesPath, selector, properties])
|
||||
|
||||
serialize: ->
|
||||
|
||||
@@ -19,7 +19,7 @@ class AtomTheme extends Theme
|
||||
else
|
||||
metadataPath = fsUtils.resolveExtension(path.join(@path, 'package'), ['cson', 'json'])
|
||||
if fsUtils.isFileSync(metadataPath)
|
||||
stylesheetNames = fsUtils.readObject(metadataPath)?.stylesheets
|
||||
stylesheetNames = fsUtils.readObjectSync(metadataPath)?.stylesheets
|
||||
if stylesheetNames
|
||||
for name in stylesheetNames
|
||||
filename = fsUtils.resolveExtension(path.join(@path, name), ['.css', '.less', ''])
|
||||
|
||||
@@ -16,14 +16,14 @@ class TextMateGrammar
|
||||
fsUtils.readPlist(path)
|
||||
|
||||
@load: (path, done) ->
|
||||
fsUtils.readObjectAsync path, (err, object) ->
|
||||
fsUtils.readObject path, (err, object) ->
|
||||
if err
|
||||
done(err)
|
||||
else
|
||||
done(null, new TextMateGrammar(object))
|
||||
|
||||
@loadSync: (path) ->
|
||||
new TextMateGrammar(fsUtils.readObject(path))
|
||||
new TextMateGrammar(fsUtils.readObjectSync(path))
|
||||
|
||||
name: null
|
||||
rawPatterns: null
|
||||
|
||||
@@ -95,7 +95,7 @@ class TextMatePackage extends Package
|
||||
@scopedProperties.push({selector, properties})
|
||||
|
||||
for preferencePath in fsUtils.listSync(@getPreferencesPath())
|
||||
{scope, settings} = fsUtils.readObject(preferencePath)
|
||||
{scope, settings} = fsUtils.readObjectSync(preferencePath)
|
||||
if properties = @propertiesFromTextMateSettings(settings)
|
||||
selector = syntax.cssSelectorFromScopeSelector(scope) if scope?
|
||||
@scopedProperties.push({selector, properties})
|
||||
@@ -136,7 +136,7 @@ class TextMatePackage extends Package
|
||||
return
|
||||
|
||||
loadPreferencesAtPath = (preferencePath, done) ->
|
||||
fsUtils.readObjectAsync preferencePath, (error, preferences) =>
|
||||
fsUtils.readObject preferencePath, (error, preferences) =>
|
||||
if error?
|
||||
console.warn("Failed to parse preference at path '#{preferencePath}'", error.stack, error)
|
||||
else
|
||||
|
||||
@@ -300,14 +300,14 @@ module.exports =
|
||||
catch err
|
||||
done(err)
|
||||
|
||||
readObject: (path) ->
|
||||
readObjectSync: (path) ->
|
||||
CSON = require 'season'
|
||||
if CSON.isObjectPath(path)
|
||||
CSON.readFileSync(path)
|
||||
else
|
||||
@readPlist(path)
|
||||
|
||||
readObjectAsync: (path, done) ->
|
||||
readObject: (path, done) ->
|
||||
CSON = require 'season'
|
||||
if CSON.isObjectPath(path)
|
||||
CSON.readFile(path, done)
|
||||
|
||||
Reference in New Issue
Block a user