Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go To Definition. #76

Closed
mfcd opened this issue Jan 6, 2016 · 12 comments
Closed

Go To Definition. #76

mfcd opened this issue Jan 6, 2016 · 12 comments

Comments

@mfcd
Copy link

mfcd commented Jan 6, 2016

Hi,

New to Juno and new to Atom.
Trying to get some sort of Go To Definition.

I have tried to configure the goto package but not sure how to proceed.
Due to performance issues, I'd like to avoid Hydrogen

Thanks.

@sglyon
Copy link
Contributor

sglyon commented Jan 7, 2016

I use the atom-ctags and have this content my ~/.ctags file.

There are some rough edges, but it does work pretty well

@pfitzseb
Copy link
Member

pfitzseb commented Jan 7, 2016

You can also use the Toggle methods command (at least on master), which will display all the method for any given function call with clickable links to their respective definitions.

We should probably use an interface similar to that of atom-ctags though, I like it -- doesn't require a mouse.

@sglyon
Copy link
Contributor

sglyon commented Jan 7, 2016

Good point!

Could we have a command that gathers the info from Toggle methods, puts it in a modal (like you get from cmd+shift+p on osx) and lets the user select which method they want to visit?

@pfitzseb
Copy link
Member

pfitzseb commented Jan 7, 2016

Yeah, shouldn't be too much trouble to implement. I'll have a look.

@pfitzseb
Copy link
Member

pfitzseb commented Jan 7, 2016

Oh well, not as easy as I thought. I've made some progress, but haven't quite got this working.

In principle though this is sooo much nicer than my old implementation -- thanks for bringing it up!

@pfitzseb
Copy link
Member

pfitzseb commented Jan 8, 2016

Success:
methodsview
Needs a bit of cleaning up and nicer display (something like the path or at least the file any given method's defined in), but basically works.

@sglyon
Copy link
Contributor

sglyon commented Jan 8, 2016

Nice, that looks like a great start.

I would also vote that you have the path

@sglyon
Copy link
Contributor

sglyon commented Jan 8, 2016

This is the UX from atom-ctags.

screen shot 2016-01-08 at 8 46 30 am

I think that they do a good job with the line number and file - but I like the way you handled types. Maybe we could implement something similar for method location on top of what you have? Also can we drop the margins on the modal?

@pfitzseb
Copy link
Member

pfitzseb commented Jan 8, 2016

Sure, that's just style stuff and shouldn't be too hard.

I'm just a bit conflicted on how to handle the intercommunication from Julia to Atom for things like this where we actually return data instead of DOM nodes. Either I implement it how I think it should be done (construct an array of method-objects in Julia that contains method signature, filename and line number), duplicate quite a lot of effort in Atom.jl and do it completly different than what Atom.jl does otherwise, or I try to hack something together to extract the path from the dom node or something.

Basically I'm not sure if the current apporach of doing most of the rendering in Atom.jl is a good approach -- it's pretty different from what I'd understand as the usual MVC-approach.

/rambling-over

@sglyon
Copy link
Contributor

sglyon commented Jan 8, 2016

I'm a little confused.

I would imagine something like this:

  • atom-julia-client asks Atom.jl for method info (e.g. calls methods(func_name) for the func_name under cursor)
  • Atom.jl then gives atom-julia-client a vector of 3-tuples: (method signature, file, line)
  • atom-julia-client then throws them into a stylized modal.

This might be what you are already doing, I'm not sure. Does that not seem to work for some reason?

@pfitzseb
Copy link
Member

pfitzseb commented Jan 8, 2016

Yeah, that's exactly what I'm doing. It's just different from what the rest of Juno is doing, where we do pretty much all the rendering in Julia and pass the complete dom nodes to Atom. And because of that, most methods deal with those nodes -- setting up file links is annoying because of that for example.

@kindlychung
Copy link

On a modern IDE, people usually expect to ctrl-click on a function/variable to jump to its definition.

@pfitzseb pfitzseb mentioned this issue Jun 26, 2017
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants