gcv / julia-snail

An Emacs development environment for Julia
GNU General Public License v3.0
231 stars 21 forks source link

Feature request: Code navigation from the REPL and from the editor #63

Closed tencnivel closed 2 years ago

tencnivel commented 2 years ago

Mimicking how Juno does it would be fantastic

gcv commented 2 years ago

Can you be more specific? I don't use Juno and do not know what you're talking about.

tencnivel commented 2 years ago

Use case from the editor (equivalent to what Atom does when hitting C-j C-g):

When hitting the corresponding key binding we get the choice of what method we want to open (theoretically, Atom should be able to identify which method to open but it does not. The macro @which of CodeTracking.jl manages to identify the right method) image

When selecting the method, Atom opens the source file with the cursor at the right location in another tab.

Use case from the REPL

Suppose an error is thrown, the error message appears in the REPL together with the stack trace. Every line of the stack trace tells which source files and lines. When clicking on a line of the stacktrace it opens a new tab for the corresponding file at the corresponding line. In the example of this screenshot, it would open my-functions.jl at line 2 and MyJuliaProject.jl at line 10 image

gcv commented 2 years ago

Code navigation in source buffers is available using the Emacs xref mechanism. See xref-find-definitions and xref-find-apropos. It probably doesn't work for you yet because of #62.

About jumping to definitions from the REPL, see #45. It doesn't quite work, probably because of something with vterm. It seems fixable; patches welcome.

tencnivel commented 2 years ago

Code navigation works from the editor (with #62 fixed)

I'll have a look at #45

thanks!