Arquivos
atom/spec/fixtures/packages/package-with-activation-commands/index.coffee
T
Nathan Sobo 1e6e724be7 Deprecate atom.views.getView and store view registry on WorkspaceElement
This separates the role of the ViewFactory from the ViewRegistry.
The ViewFactory creates *new* views. The ViewRegistry maintains a
persistent 1:1 mapping from models to views, and is owned by the
workspace rather than being a global service. If someone wants to 
*create* a view, they use atom.views.createView. If someone wants to
get the workspace’s view element for a given model, they call .getView
on the workspace.
2014-11-30 17:12:35 -07:00

15 linhas
461 B
CoffeeScript

module.exports =
activateCallCount: 0
activationCommandCallCount: 0
legacyActivationCommandCallCount: 0
activate: ->
@activateCallCount++
atom.commands.add 'atom-workspace', 'activation-command', =>
@activationCommandCallCount++
editorView = document.querySelector('atom-workspace').getView(atom.workspace.getActiveEditor())?.__spacePenView
editorView?.command 'activation-command', =>
@legacyActivationCommandCallCount++