GithubHelp home page GithubHelp logo

language-pick-basic's People

Contributors

burneyhoel avatar theexec avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

deanwookey

language-pick-basic's Issues

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

Hi! Thanks for maintaining the language-pick-basic package!

In Atom v1.19, we will release a major change 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

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:

Changes to TextEditor.onDidChange and TextBuffer.onDidChange coming in Atom 1.23

Hi! Thanks for maintaining the language-pick-basic package!

In Atom v1.23, we will some changes that may affect your package.

The methods TextEditor.onDidChange and TextBuffer.onDidChange will now call their callbacks less frequently. Previously, these callbacks would get called once for each individual change to the buffer. So if you had 5 cursors and typed a character, they would get called 5 times. Now, they will only get called once, and the event that is passed to them will contain information about all 5 of the changes that have occurred.

The same properties that have always existed on the TextBuffer.onDidChange events (oldRange, newRange, oldText, and newText) will still be there, and they will now reflect the sum of all changes that have occurred. But now there will be an additional property called changes, which will contain an array of more fine-grained objects describing the individual changes. We encourage you to use this property instead of the old ones.

Effects on this package

It looks like this package 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 is likely that you do not need to do anything. The old event properties will continue to work.

However, you may be able to handle changes more accurately and efficiently by using the changes field of the events rather than the old properties. The changes field does not exist in Atom 1.22 unless you use the TextBuffer.onDidChangeText method. In Atom 1.23 and above though, .onDidChange and .onDidChangeText will become identical, having both the old properties and the new changes property.

Please let me know if you have any questions. I would be happy to help!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.