Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
Jump to definition of symbol #231
Comments
chrisdone
added
type: enhancement
component: emacs
labels
Aug 16, 2016
|
I think with |
|
Yup, definitely something I'd like to see as well. Currently stack unpacks source to a temp dir, best solution for this would have it leave the source in a location (read-only?) |
chrisdone
added
the
priority: low
label
Nov 23, 2016
|
@chrisdone How exactly do you imagine that this would be implemented. This is something that I'd really like to see, and I have some extra time so I'd love to help out however I can. |
|
Intero has the package name and version when you try to jump to definition.
So Intero could run stack unpack on that exact version into .stack/sources
or whatever the correct location is. Then the problem is finding the right
file. GHC might have original file info, might not. This is the key
question mark.
Once you have the file Emacs can jump to it. This will cause Intero to
start another session for that project and load it up too. With the recent
Intero blacklisting support, you could disable that if the projects you're
looking at are large.
That's as far as I got.
…
|
michalrus
referenced this issue
Jul 6, 2017
Closed
the problem of intero-mode jumping to definition #435
chrissound
commented
Aug 6, 2017
|
In the event it is useful: this functionality is present in the intellij plugin: https://github.com/rikvdkleij/intellij-haskell |
SamuraiJack
commented
Aug 13, 2017
|
+1 for this feature (already implemented in the IntelliJ plugin) |
jesuspc
commented
Oct 3, 2017
|
+1 |
kRITZCREEK
commented
Oct 3, 2017
|
Stop this. Github introduced the |
matthew-piziak
commented
Oct 3, 2017
|
That may be the point. I am not surprised that people really want basic navigation. |
matthew-piziak
commented
Oct 3, 2017
|
@chrisdone I'm guessing this is marked as |
|
I don't think there are new developments here. This is actually quite an involved feature to implement. Don't let that dissuade y'all, though. If someone wants to implement this, it'd be greatly appreciated by everyone! |
matthew-piziak
commented
Oct 4, 2017
|
Thanks @mgsloan! I don't mean to understate the difficulty of course. :) |
yilinwei
commented
Oct 28, 2017
|
@chrisdone I've been taking a look at this at the same time as #129 and was wondering whether you knew of a better way that going to the using haddock generated html files to get the line info? Would that still be an acceptable way of doing it? |
|
@yilinwei It may also be worthwhile investigating if the .hi files have the requisite info, I'm not sure if they do, but perhaps they should! Last resort would be to run intero on every dependency and output a metadata file. Could get tricky for running it on builtin libraries. This could be useful for other reasons, though. Some info definitely isn't in .hi files, such as "find usages". Imagine if you could use "find usages" to find all usages of an identifier in your dependencies, possibly all usages in the entire stackage snapshot. This would be really powerful! I feel like I've written something about this before, but can't find it easily with a search of this repo's issues. Could even consider distributing these metadata files, but that is frought with problems because they may depend on selection of flags, may even depend on dependencies. Due to TH, could depend on practically anything. |
I'm pretty sure that they don't, but I agree that they should. It wouldn't be hard to make a change to ghc to add this would it? |
Probably not! Likely worthwhile. It'd probably be good to add support to ghci / intero as part of that, as it might be hard to get it merged without a concrete application. I am rather partial to generating a metadata file, but that should also happen in ghc. Otherwise we'll need to build the deps twice just to generate metadata - ugh |
adam-singer commentedAug 14, 2016
A feature request, if not already requested, adding support to jump to definition of symbol even if dependency. A nice feature that exists for haskell-vim-now (codex + hasktags) is the ability to have ctags generated for project and dependencies to do navigation.
Would be nice if that was out of the box support with intero instead of baking up own solution.