atom-community / atom-ide-definitions

Definitions for Atom IDE
https://atom.io/packages/atom-ide-definitions
Other
24 stars 4 forks source link

What is a definition please? #6

Closed tomachinz closed 5 years ago

tomachinz commented 5 years ago

The package description could explain what a definition is.

ryanolsonx commented 5 years ago

Good idea. A definition is where a symbol under your cursor was defined.

For example, if you have this code (| signifies where the cursor is):

function goToHomePage() {
  window.location.href = "https://google.com";
}

function handleClick(e) {
  goTo|HomePage();
}

When you go to definition, it would take you to where that goToHomePage function is defined. The cursor would move to line 1. If that function was defined in another file, it could possibly go to that function there (depending on if you import that function or use it as a global).

Belar commented 5 years ago

As @ryanolsonx explained, definition is where target (variable, function, class etc.) has been defined. We could add a gif presenting the functionality, similar to the one in old ide-ui package.