Replace deprecated GetPaneViews


#1

I am updating a package to remove deprecations (atom-runner).

The code iterates through each pane to try to find AtomRunnerView.

It currently uses this code to get a list of views to check:

 runnerView: ->
    for pane in atom.workspaceView.getPaneViews()
      for view in pane.getItems()
        return {pane: pane, view: view} if view instanceof AtomRunnerView
    {pane: null, view: null}

How do I do this properly with non-deprecated calls?
Thanks


#2

I just went through this. It has been simplified to atom.workspace.getPaneItems().

Edit: And to turn items into views you use atom.views.getView(item).


#3

Awesome, thanks mate :smile: