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

Jump to source #4

Open
bomgar opened this issue Mar 9, 2016 · 8 comments
Open

Jump to source #4

bomgar opened this issue Mar 9, 2016 · 8 comments

Comments

@bomgar
Copy link
Member

bomgar commented Mar 9, 2016

jump to referenced controller method

@WarFox
Copy link

WarFox commented Jun 27, 2017

this would be a great feature to have! Do you know if we can use ensime to do this?

@bomgar
Copy link
Member Author

bomgar commented Jun 27, 2017

I would love an integration with ensime. It probably should be an optional dependency.

@WarFox
Copy link

WarFox commented Jun 28, 2017

Thanks for the response @bomgar.
I would like to make this happen. Do you have an idea where to start?
I'm a newbie to elisp

@bomgar
Copy link
Member Author

bomgar commented Jun 28, 2017

My first idea was to integrate with the ensime-search feature and let ensime display the results. But this is more of a hack.
The other option would be to identify the matching part in the compiled routes file end tell ensime to go from there.
I'm not really sure how to approach this. @fommil do you have any input on this?

As for the optional dependency part you can have a look at the ensime-helm integration.

@fommil
Copy link

fommil commented Jun 28, 2017

ensime would need a scala source file to be able to correctly know the FQN, but if you know the classname or something you could forward to ensime-search.

I don't really know play very well... can you do string based search?

You could add a rule for parsing routes strings into ctags if it's regular enough.

@bomgar
Copy link
Member Author

bomgar commented Jun 28, 2017

The play routes file compiles to a scala file. Ensime should be able to process this. I don't know if ensime indexes generated sources.

@bomgar
Copy link
Member Author

bomgar commented Jun 28, 2017

String based ensime-search is also possible because we know the class and method name in the routes file. This could be good enough.

@mriehl
Copy link
Member

mriehl commented Jun 28, 2017

Best-effort search on the class name and feeding it into ensime-search sounds like a good starting point.

Getting the right class and method without compiling will be pretty hard though because the class can be in a package structure and the method can be arbitrarily nested inside the class (or even imported from somewhere else).

Now that I think of it an even better solution could be to C-c C-v v (symbol search) with ensime on just the method name and jump there (1 search hit) or drop the user into helm/ido (2+ search hits).
Determining the "apply thing" name (usually a method) should be really trivial with a regex on the line

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
@WarFox @bomgar @fommil @mriehl and others