         @activateServices()
       @activationCommandSubscriptions?.dispose()
       @activationHookSubscriptions?.dispose()
+      @workspaceOpenerSubscriptions?.dispose()
     catch error
       @handleError("Failed to activate the #{@name} package", error)
 

        @activationHooks.push(@metadata.activationHooks)

    @activationHooks = _.uniq(@activationHooks)

  getURIHandler: ->
    @metadata?.uriHandler

      @mainModulePath = fs.resolveExtension(mainModulePath, ["", CompileCache.supportedExtensions...])

  activationShouldBeDeferred: ->
    (@hasActivationCommands() or @hasActivationHooks() or @hasWorkspaceOpeners() or @hasDeferredURIHandler()) and not @deserialized

  hasActivationCommands: ->
    for selector, commands of @getActivationCommands()
      return true if commands.length > 0
    false

  hasActivationHooks: ->
    @getActivationHooks()?.length > 0

  hasWorkspaceOpeners: ->
    @getWorkspaceOpeners()?.length > 0

  hasDeferredURIHandler: ->
    @getURIHandler() and @getURIHandler().deferActivation isnt false

  subscribeToDeferredActivation: ->
    @subscribeToActivationCommands()
    @subscribeToActivationHooks()
    @subscribeToWorkspaceOpeners()

  subscribeToActivationCommands: ->
    @activationCommandSubscriptions = new CompositeDisposable
