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

Open
adam-singer opened this Issue Aug 14, 2016 · 16 comments

Comments

Projects
None yet
10 participants

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.

Owner

chrisdone commented Aug 16, 2016

I think with stack haddock we could hypothetically figure that out. I'd rather not generate tags from source when Haddock already knows how to link up symbols to their source.

Contributor

mgsloan commented Aug 16, 2016

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?)

Contributor

IvanMalison commented Nov 27, 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.

Owner

chrisdone commented Nov 27, 2016

In the event it is useful: this functionality is present in the intellij plugin: https://github.com/rikvdkleij/intellij-haskell

+1 for this feature (already implemented in the IntelliJ plugin)

jesuspc commented Oct 3, 2017

+1

Stop this. Github introduced the 👍 button for exactly that reason. You're just creating noise.

That may be the point. I am not surprised that people really want basic navigation.

@chrisdone I'm guessing this is marked as priority: low because of blocking difficulties (#231 (comment)) and not because the feature is not deemed important, is that right? Are there any new developments since last year that might make this more possible now?

Contributor

mgsloan commented Oct 3, 2017

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!

Thanks @mgsloan! I don't mean to understate the difficulty of course. :)

@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?

Contributor

mgsloan commented Oct 29, 2017

@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.

Contributor

IvanMalison commented Oct 29, 2017

@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!

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?

Contributor

mgsloan commented Oct 29, 2017 edited

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment