     @measure 'loadTime', =>
       @metadata = Package.loadMetadata(@path, true)
 
-  activate: ({sync}={})->
-    if sync
+  activate: ({sync, immediate}={})->
+    if sync or immediate
       @loadGrammarsSync()
       @loadScopedPropertiesSync()
     else
-      TextMatePackage.getActivationQueue().push(this)
+      TextMatePackage.addPackageToActivationQueue(this)
 
   activateConfig: -> # noop
 

      completions: textMateSettings.completions
    )
    { editor: editorProperties } if _.size(editorProperties) > 0

    packageName = path.basename(packageName)
    /(^language-.+)|((\.|_|-)tmbundle$)/.test(packageName)

  @addPackageToActivationQueue: (pack)->
    @activationQueue ?= []
    @activationQueue.push(pack)
    @activateNextPacakageInQueue() if @activationQueue.length == 1

  @activateNextPacakageInQueue: ->
    if pack = @activationQueue[0]
      pack.loadGrammars()
        .then ->
          pack.loadScopedProperties()
        .then ->
          @activationQueue.shift()
          @activateNextPacakageInQueue()

  constructor: ->
    super
