Replace LoadTextMatePackagesTask with async grammar loading

This commit is contained in:
Nathan Sobo
2013-03-20 18:55:28 -06:00
parent 8e57ee2776
commit ab934cfbfb
9 changed files with 61 additions and 88 deletions

View File

@@ -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) =>