Skip to content

Show where the definition was imported from #935

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

Closed
domenkozar opened this issue Apr 7, 2020 · 4 comments
Closed

Show where the definition was imported from #935

domenkozar opened this issue Apr 7, 2020 · 4 comments

Comments

@domenkozar
Copy link
Contributor

I often wonder where is something imported from. For an example dimap could come from any of the imports since I know I don't import any profunctor packages.

Proposal: Defined in <module>, imported from <module>

@mpickering
Copy link
Contributor

What do you want to do with this information? It seems possible your issue may be solved more directly.

@domenkozar
Copy link
Contributor Author

I'd like to import it in another file.

While there is a code action to add an import for a binding, it usually lists quite a bunch of possibilities.

One option would be to group import suggestions by existing and available imports in the project.

@ndmitchell
Copy link
Collaborator

What I often want to do is copy a fragment of code from one module, paste it in another, and "drag" all the imports that were required across. E.g. if one module has import Data.HashMap as HM and I copy the expression HM.filter then I want the import moving to the new module (or even better, adjusting if I have Data.HashMap as HM2 in that file. Knowing that the foo keyword comes via a particular import is one way to do that slightly manually.

@jneira
Copy link
Member

jneira commented Oct 5, 2020

Afaict the info on hover already include the Defined in <Module> in ghcide/hls (not sure what pr did the change)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants