Remove synchronous package loading shims

This commit is contained in:
probablycorey
2014-02-10 15:50:50 -08:00
parent 5b6e0b769d
commit 2a2858554a
2 changed files with 2 additions and 28 deletions

View File

@@ -73,21 +73,6 @@ class AtomPackage extends Package
@activationDeferred.promise
# Deprecated
activateSync: ({immediate}={}) ->
@activateResources()
if @metadata.activationEvents? and not immediate
@subscribeToActivationEvents()
else
try
@activateConfig()
@activateStylesheets()
if @requireMainModule()
@mainModule.activate(atom.packages.getPackageState(@name) ? {})
@mainActivated = true
catch e
console.warn "Failed to activate package named '#{@name}'", e.stack
activateNow: ->
try
@activateConfig()

View File

@@ -81,26 +81,15 @@ class PackageManager
@observeDisabledPackages()
# Activate a single package by name
activatePackage: (name, options={}) ->
if options.sync? or options.immediate?
return @activatePackageSync(name, options)
activatePackage: (name) ->
if pack = @getActivePackage(name)
Q(pack)
else
pack = @loadPackage(name)
pack.activate(options).then =>
pack.activate().then =>
@activePackages[pack.name] = pack
pack
# Deprecated
activatePackageSync: (name, options) ->
return pack if pack = @getActivePackage(name)
if pack = @loadPackage(name)
@activePackages[pack.name] = pack
pack.activateSync(options)
pack
# Deactivate all packages
deactivatePackages: ->
@deactivatePackage(pack.name) for pack in @getLoadedPackages()