mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Memoize built packages
Packages that successfully built are now stored internally so they can be quickly accessed on future calls instead of returning an array of newly built packages on each call.
This commit is contained in:
@@ -25,7 +25,9 @@ _.extend atom,
|
||||
new LoadTextMatePackagesTask(asyncTextMatePackages).start()
|
||||
|
||||
getPackages: ->
|
||||
@getPackageNames().map((name) -> Package.build(name)).filter (pack) -> pack?
|
||||
@packages ?= @getPackageNames().map((name) -> Package.build(name))
|
||||
.filter((pack) -> pack?)
|
||||
new Array(@packages...)
|
||||
|
||||
loadTextMatePackages: ->
|
||||
pack.load() for pack in @getTextMatePackages()
|
||||
|
||||
@@ -250,6 +250,7 @@ describe "Snippets extension", ->
|
||||
|
||||
describe "snippet loading", ->
|
||||
beforeEach ->
|
||||
atom.packages = null
|
||||
jasmine.unspy(LoadSnippetsTask.prototype, 'start')
|
||||
spyOn(LoadSnippetsTask.prototype, 'loadAtomSnippets').andCallFake -> @snippetsLoaded({})
|
||||
spyOn(LoadSnippetsTask.prototype, 'loadTextMateSnippets').andCallFake -> @snippetsLoaded({})
|
||||
|
||||
Reference in New Issue
Block a user