- Notifications
You must be signed in to change notification settings - Fork5
Changes required due to TextBuffer.save becoming async in Atom 1.19 #27
Description
Hi! Thanks for maintaining the atom-coderoad package!
In Atom v1.19, we will release amajor change to Atom's core text buffer data structure. As part of this change, we have madeTextBuffer.save
asynchronous; rather than blocking until the save is complete, it now immediately returns aPromise
thatresolves when the save is complete. Because of this, a few other Atom APIs thatusesave
have similarly become async:
Pane.close
TextBuffer.save
TextEditor.save
Pane.saveItem
Pane.saveItemAs
Pane.saveActiveItem
Pane.saveActiveItemAs
Pane.saveItems
Workspace.saveActivePaneItem
Workspace.saveActivePaneItemAs
Effects on this package
We think this package could be impacted by this upgrade because it calls the changed methods in the following places:
We found these calls using a regex search, so this list might be incomplete, and it might contain some false positives.
What to do about the change
It should be pretty easy to adjust your package code and/or tests to work with the new async behavior, and to simultaneously keep it working with older versions of Atom. Here are some examples of pull requests we opened on our bundled packages to cope with the change:
- Adjust test to work when TextBuffer.save is made async atom/autocomplete-plus#852
- Don't assume that save is synchronous in specs atom/whitespace#155
- Wait for save to complete in tests atom/symbols-view#222
- Wait for save to complete in buffer modifier indicator test atom/status-bar#193
- Tweak tests so that they work when Pane.close becomes async atom/tabs#448
Please let me know if you have any questions, I'd be happy to help!