Giter VIP home page Giter VIP logo

token-navigation's Introduction

token-navigation package

Grammatically meaningful code navigation in javascript. Jump from token to token, ignoring those which you consider less important in settings.

Jumping tokens

Travel to the next (alt + h) or previous (alt + l) piece of meaningful code.

Fuzzy search!

Jump tokens with fuzzy searching with alt + f. Travel your code at the speed of light no matter how slow your memory is. Once there are results:

  • enter to select next one
  • shift + enter to select previous one
  • alt + enter to select all

How it works

When using the shortcut for next or previous token, the whole file will be parsed by babel and then the cursor will travel and select to the next or previous token. This could appear to be a slow process, but it actually is not. The only issue I found is that while developing we often have code that does not conform a valid abstract syntax tree. For those cases I have provided a regex based parser that, despite silly, is good enough until we can use babel for tokenizing again.

For fuzzy token jumping the behaviour is similar. Once the tokens are produced they will be fuzzy-mathed with the given pattern, allowing quick travel between them.

token-navigation's People

Contributors

germtb avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

token-navigation's Issues

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

Hi! Thanks for maintaining the token-navigation 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.