How to jump to definition in Juno?

I am trying Juno once again, and I this time I will try to stick with it for a longer period.

One of the basic things that I would like to have is ctags-like functionality to jump in the code to the definition of a method or type. Is it currently possible? Can you share your current practices for writing Julia packages in Juno?

Any video demonstrating all the latest features specific to Julia?

Double-click the symbol you’re interested in and then right click. Select from the context menu “Go to definition”. If there are multiple definitions you will get another menu from which to select which one you want.

1 Like

Sorry, I forgot: it works for me for modules that have been “using” brought in. I think understandably Julia needs to know about the code in order to be able to jump to the definition.

1 Like

Thank you @PetrKryslUCSD, I think that was the issue I was having, not loading the package. Is there any shortcut for it?

My ideal use case would be to have the cursor on top of the word and press a key combination to reach the definition.

How could it know where it’s defined without loading the package? You can have multiple definitions of the same terms so what you have in the workspace depends on what you have using.

1 Like

Hi @ChrisRackauckas, I am used to ctags, it works with C++ for example, where no information at all is available to the editor about the types (works before compilation). I may check ctags for Atom as well to see if it fits my needs.

Basically, ctags needs a first pass on the source code to create a searchable database. In VIM, I could update this database at every new release of my projects very quickly with one command.

Atom’s ctags plugin doesn’t support Julia, so it’s basically useless.

The shortcut for Go to definition is Ctrl-JCtrl-G by default (and that command will finally support macros in the next version).

Juno’s workflow usually is more interactive than you might be used to, which imho makes it more produtive and also means that you’ll generally have all necessary packages loaded and the runtime knows about all the symbols you’re working with. If you want static code analysis etc you could also use VSCode with the Julia plugin or the (very) experimental LS implementation for Atom (see here).

4 Likes