From 0b314ac1a98ca06c82fc369fffe4f13fc772abe5 Mon Sep 17 00:00:00 2001 From: Jason Rudolph Date: Thu, 1 Jun 2017 15:26:09 -0400 Subject: [PATCH] :fire: Remove broken Dock::observeTextEditors(callback) fn We're updating Atom to disallow editors in docks. As a result, we need to remove Dock::observeTextEditors(callback). Normally, we would deprecate a method before removing it, but this method is broken and has never worked: atom.workspace.getLeftDock().observeTextEditors(console.log) (unknown) Uncaught TypeError: this.paneContainer.getTextEditors is not a function at Dock.getTextEditors (/Applications/Atom.app/Contents/Resources/app/src/dock.js:590:37) at Dock.observeTextEditors (/Applications/Atom.app/Contents/Resources/app/src/dock.js:396:41) at :1:30 getTextEditors @ :29933 observeTextEditors @ :29739 (anonymous) @ VM1941:1 Since the method is broken, we know that nobody is relying on it. Instead of deprecating the method, we can just remove it. --- src/dock.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/dock.js b/src/dock.js index f354f1b90..8f49528f1 100644 --- a/src/dock.js +++ b/src/dock.js @@ -385,21 +385,6 @@ module.exports = class Dock { Section: Event Subscription */ - // Essential: Invoke the given callback with all current and future text - // editors in the dock. - // - // * `callback` {Function} to be called with current and future text editors. - // * `editor` An {TextEditor} that is present in {::getTextEditors} at the time - // of subscription or that is added at some later time. - // - // Returns a {Disposable} on which `.dispose()` can be called to unsubscribe. - observeTextEditors (callback) { - for (const textEditor of this.getTextEditors()) { - callback(textEditor) - } - return this.onDidAddTextEditor(({textEditor}) => callback(textEditor)) - } - // Essential: Invoke the given callback with all current and future panes items // in the dock. //