abiosoft / abiosoft/atom-go-imports

Changes required due to TextBuffer.save becoming async in Atom 1.19

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
CoffeeScript
Stars
3
Forks
1
PR merge metrics
No merged PRs in 30d

Description

Hi! Thanks for maintaining the go-imports package!

In Atom v1.19, we will release a [major change](https://github.com/atom/atom/pull/14435) to Atom's core text buffer data structure. As part of this change, we have made `TextBuffer.save` asynchronous; rather than blocking until the save is complete, it now immediately returns a `Promise` that *resolves* when the save is complete. Because of this, a few other Atom APIs that *use* `save` 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:

* `TextBuffer.save`
* [here](https://github.com/abiosoft/atom-go-imports/tree/master/lib/go-imports.coffee#L20)
* [here](https://github.com/abiosoft/atom-go-imports/tree/master/lib/go-imports.coffee#L35)

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:

* https://github.com/atom/autocomplete-plus/pull/852
* https://github.com/atom/whitespace/pull/155
* https://github.com/atom/line-ending-selector/pull/45
* https://github.com/atom/symbols-view/pull/222
* https://github.com/atom/status-bar/pull/193
* https://github.com/atom/tabs/pull/448

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.