Is there a simple go-to-definition


#1

In WebStorm I am used to clicking on a variable with the ctrl key to go to the variable’s definition. Using a keypress would also be fine.

The only package that claims to offer this is atom-ctags but it seems overly complex with more features like auto-complete that I don’t want. Also I can’t get it to work but that is a different question.

(Atom-Ctags (autocomplete+ with ctags)).

Any suggestions?


#2

I use the symbol-gen package. It also includes a definition for CoffeeScript so that it is supported by Ctags.


#3

Thanks once again.

There was no command other than generate in symbol-gen so I assume you mean to use symbols-view after symbol-gen? I’m getting a node-gyp error trying to install symbols-view. I think it is trying to build ctags even though I don’t think I need ctags.

In any case I don’t think any of these will operate with simple keypresses. I’m too lazy to open a dialog, type something, and click on a choice. I want to find a definition by just clicking on a word.

I guess it’s time to pull out the package generator again. A simple package to do this would be similar to my find-selection package. That was another feature from webstorm that let me avoid tedious dialogs.


#4

Yep, that’s what I use after I use symbol-gen to generate the ctags. I guess I got fixated on your post in the other topic relying on ctags :grinning:


#5

Ok, let’s say you have something like

include ../_header

In modern IDEs holding Cmd (or Ctrl) while hovering over ../_header would highlight it like a link and allow me to quickly open that file. Also, as you can see, this definition can drop the extension declaration, in this case it should automatically assume I am looking for a file with the same extension as the file I am currently editing. E.g. if I am in index.jade, it would look for ../_header.jade.

Is it possible with current Atom? Or should I start to get my hands dirty on my first module? :slight_smile:


#6

There’s nothing built into Atom that does this currently, no.


#7

Want that so hard… please make it?


#8

And I can say the same to you. (grin) It would be a great package.


#9

can you try the navigate packagehttps://atom.io/packages/navigate. It would not hyperlink. but if you think it is a valid file link…f2 to navigate into the file…and f3 to navigate back to the original file.

may be as I find time I would add the ctag/symbols to add navigate to variable defnition


#10

+1 on this feature


#11

I also would like this, especially when I see function calls I want to jump to the function definition. In Visual Studio this was possible with F12.

Another great feature would be a tool tip if you hover over a function call that shows you the comment header and other stuff, like overloads.


#12

There is such a package called code-links. Check it!


#13

There’s goto package which replaces symbols-view (which can be disabled); no ctags needed


#14

Wow, goto works great. Thanks @fernandopsilveira! If you maybe know, I’m interested why this is working even for languages where symbols-view won’t work? Then I’m asking Atom developers why/how is symbols-view better than this?

I wanted to do a research on how to make Elm language work with this and goto package auto/magically works :slight_smile:


#15

I just installed hyperlink and js-hyperlink packages and I’m really enjoying moving cmd + click move to file! :slight_smile:


#16

@zigomir: It looks to me like the go-to package works because it is using the language definition files to identify symbols. You have language-elm installed, so that works. symbols-view doesn’t work because it uses ctags to generate its tokens, and I’m guessing that ctags doesn’t have any support by default for Elm.

I did a quick google search, and found someone who put some config in their rcfiles for ctags & Elm support: https://github.com/grassdog/dotfiles/blob/master/ctags#L110

It’s possible that if you use those same config values, and start Atom from the command line, symbols-view will work.


#17

i’ve found this great extension very handfull for javascript development: https://atom.io/packages/js-hyperclick
ofcourse u need https://atom.io/packages/hyperclick first in order to use it for js


#18

Hi I’ve insatalled hyperclick, js-hyperclick and goto packages but I cannot go to the declaration of my css classes when I press ctrl + click over the classes used in my html files. Is this possible with these packages?


#19

@Lobosan I wonder the same thing


#20

Hi. I installed two packages as it was recommended above.


https://atom.io/packages/hyperclick.

But it always throw me to *.js files, but my are *.es.
How can I configure it?