Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get atom.io's "Go to Declaration" to really do that?

In atom.io, if I right click in "wrappedlabel" here:

<label class="wrappedlabel">"Be Kind to Animammals - Kiss a Duckbilled Platypus Today"</label> 

...it teases me with "Go to Declaration"

Clicking does not take me to that class in the .css file in the project.

Is there a way to get this to actually work? If so, it would be an even sweeter suite. Having it tell me "Go to Declaration" and then leaving me hanging is better than telling me to "go to" [somewhere else], but still...

like image 1000
B. Clay Shannon-B. Crow Raven Avatar asked Aug 18 '15 21:08

B. Clay Shannon-B. Crow Raven


People also ask

Can you code on Atom?

Atom and other text editors are able to interpret file extensions and provide language-specific syntax highlighting. Syntax highlighting is a tool for making code easier to read. Take a look at your index. html file.


2 Answers

"Go to declaration" works with symbols used in your project.

The feature requires ctags which need to be generated per project. This can be achieved with the command line or with an atom plugin (https://atom.io/packages/symbol-gen) .

You can follow this issue on github for further details

like image 60
Richard Dev Avatar answered Oct 09 '22 01:10

Richard Dev


  • In a terminal run

    apm install atom-ctags 
  • Restart atom (sometimes twice)

  • Open a file in your project
  • Context menu - rebuild ctags
  • Go to declaration should now work for most places
like image 36
Richard Avatar answered Oct 08 '22 23:10

Richard