-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Can not go to definition of non local libraries (i.e. dependencies) #708
Comments
Currently goto definition only works for the local package. Where should it take you for the base library? Typically people don't even have a copy of the source installed. The Haddock documentation is one option, but it's no longer really goto definition... |
fwiw we do have some logic for cross-package goto definition based on HIE files that works for DAML. It allows you to configure the location of the sources so it would be possible to point it to something like |
Could we add support for goto documentation? |
This doesn't help in the short term, but it's good to remember these aren't immutable restrictions. haskell-code-explorer allows cross-package jumping (so long as you've indexed each dependency) and it is insanely nice. Seriously, go to a random function and try it out. I really, really want this in my editor as well. That said, I know that PS In the meantime jumping to the Haddocks would be totally fine with me. |
I recommend using codex meanwhile. It can generate ctags for all the dependencies |
@arthurborisow: Great point as a short term solution. In the long run I'm really hoping for something better than |
Note that we have the fully qualified name, as |
This feature is included in @wz1000 hiedb branch of ghcide and merge it would bring it to master |
@wz1000 commented in a duplicate issue in how to use its hiedb branch, that includes this feature: https://github.com/haskell/ghcide/issues/745#issuecomment-683334743 |
The new pull request that will add hiedb support in hls is #704 |
This will not be addressed in #704 but in an upcoming PR. |
@wz1000 hi! had you the chance to prepare that pr finally? |
There is a closely related ghc proposal: https://discourse.haskell.org/t/extended-dependency-generation-support/2811 |
@pepeiborra @wz1000 it would be great to have some idea about the plans for this, as there are lot of people eager to see this land. Otoh i am not sure if there is a wip about or not. |
I had a somewhat working implementation of this, but there were some issues. In principle, most of what needs to be done is provide an implementation for The feature as before it was reverted by that commit worked in the following fashion
The major problems which need to be solved are:
|
many thanks for the detailed description of the state of the festure, I hope it will help to make progress on this |
The comment about the plan to get the feature has been updated by @drsooch after work in its analysis, thanks! I wonder how other langs has resolved the issue (for example ruts), maybe it would worth to have a look. |
@wz1000 Several thoughts come to mind. You've listed several blockers:
These may all be facile points coming from someone who doesn't maintain any of this software, but here are the thoughts that jump out at me:
|
With regarding to this issue, do any of the circumstances change to make go-to-definition work for packages added via |
I've developed this - https://github.com/kr3v/haskell-gtd-nl - as an attempt to implement the requested feature ('go to definition for non-local libraries'). It is independent from HLS / vscode-haskell (separate VS Code extension, separate server (low memory usage mostly, can be used with HLS on low-memory machines)). I hope it will fill the gap until the feature is added to HLS. |
haskell-docs-cli allows a variant of this. It puts the non-local files in a temporary cache directory. It seems to me that the ultimate solution is along those lines. You'd need an ability to clear and manage the cache as well. You'd want a way to handle different versions of packages likely by referencig the cabal file (at least), though there should be some Until then, haskell-docs-cli is pretty nice for jumping to source and searching hoogle/haddocks. |
So we still can't jump to definitions on base package functions? |
I just tried that and it works: Any nice way to get it to pull in all build-depends packages in a cabal file? Alternatively, to have cabal output those as a list to stdout. |
What works? You pulled it and then you were able to jump to to definition on say standard functions? For me it just says "No definition found.". |
My apologies for the confusion. I do not use I had posted that comment about The "works for me" part is appreciation for the |
Is this because it is downloaded in some binary form?
The text was updated successfully, but these errors were encountered: