mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Manage package lifecycle in Atom instead of in RootView
This commit is contained in:
@@ -65,7 +65,7 @@ class AtomPackage extends Package
|
||||
if fs.isFile(mainPath)
|
||||
@packageMain = require(mainPath)
|
||||
config.setDefaults(@name, @packageMain.configDefaults)
|
||||
rootView?.activatePackage(this)
|
||||
atom.activateAtomPackage(this)
|
||||
|
||||
loadMetadata: ->
|
||||
if metadataPath = fs.resolveExtension(fs.join(@path, 'package'), ['cson', 'json'])
|
||||
|
||||
@@ -68,7 +68,7 @@ class RootView extends View
|
||||
serialize: ->
|
||||
projectState: @project?.serialize()
|
||||
panesViewState: @panes.children().view()?.serialize()
|
||||
packageStates: @serializePackages()
|
||||
packageStates: atom.serializeAtomPackages()
|
||||
|
||||
handleFocus: (e) ->
|
||||
if @getActiveEditor()
|
||||
@@ -126,7 +126,7 @@ class RootView extends View
|
||||
|
||||
deactivate: ->
|
||||
atom.setRootViewStateForPath(@project.getPath(), @serialize())
|
||||
@deactivatePackages()
|
||||
atom.deactivateAtomPackages()
|
||||
@remove()
|
||||
|
||||
open: (path, options = {}) ->
|
||||
@@ -261,12 +261,3 @@ class RootView extends View
|
||||
|
||||
eachBuffer: (callback) ->
|
||||
@project.eachBuffer(callback)
|
||||
|
||||
activatePackage: (pack) ->
|
||||
atom.activateAtomPackage(pack)
|
||||
|
||||
deactivatePackages: ->
|
||||
atom.deactivateAtomPackages()
|
||||
|
||||
serializePackages: ->
|
||||
atom.serializeAtomPackages()
|
||||
|
||||
Reference in New Issue
Block a user