1e6e724be7
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.
15 linhas
461 B
CoffeeScript
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++
|