mirror of
https://github.com/atom/atom.git
synced 2026-02-18 10:31:54 -05:00
Replace LoadTextMatePackagesTask with async grammar loading
This commit is contained in:
@@ -69,6 +69,15 @@ module.exports =
|
||||
catch e
|
||||
false
|
||||
|
||||
isDirectoryAsync: (path, done) ->
|
||||
return done(false) unless path?.length > 0
|
||||
fs.exists path, (exists) ->
|
||||
if exists
|
||||
fs.stat path, (err, stat) ->
|
||||
done(stat?.isDirectory() ? false)
|
||||
else
|
||||
done(false)
|
||||
|
||||
# Returns true if the file specified by path exists and is a
|
||||
# regular file.
|
||||
isFile: (path) ->
|
||||
@@ -291,6 +300,13 @@ module.exports =
|
||||
else
|
||||
@readPlist(path)
|
||||
|
||||
readObjectAsync: (path, done) ->
|
||||
cson = require 'cson'
|
||||
if cson.isObjectPath(path)
|
||||
cson.readObjectAsync(path, done)
|
||||
else
|
||||
@readPlistAsync(path, done)
|
||||
|
||||
watchPath: (path, callback) ->
|
||||
path = @absolute(path)
|
||||
watchCallback = (eventType, eventPath) =>
|
||||
|
||||
Reference in New Issue
Block a user