-
-
Notifications
You must be signed in to change notification settings - Fork 387
[new plugin] Add explicit export lists to each module using the minimal import lists #450
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
Comments
The idea is that ghcide is a small core, and that plugins are used to extend it. Most of the plugins are going to live in the https://github.com/haskell/haskell-language-server repo, so I suspect that is the place to ask for a plugin to be created (or even better, to write one yourself). |
Oh, and for implementation, we don't need to rely on dump minimal imports flag - we have all the information in hand in the GHC AST, so it should be pretty easy to make the imports precisely minimal. |
Grand. |
It should be a plugin in hls so transferred |
We were calling runCradle multiple times per cradle, concurrently. For Cabal cradles this function runs Cabal, which is neither fast nor designed to be run concurrently
Not sure i minimize imports could be part of the |
Minimize imports is exactly what the refine imports plugin does. |
nice, so this can be close as already implmented :-) |
I think this should still be open --- we don't yet have "make exports explicit," do we? |
@isovector #450 (comment) writes
|
Edit: whoops. I think that was a mis-comment, because #436 is about imports. |
ugh, yeah, noted in the original comment. Change the title as minimise imports is already implemented @isovector @ocharles thanks for the correction! |
Afaiu this should be a new plugin then? |
GHC has a
-ddump-minimal-imports
flag. Would it be possible to use the ghcide apparatus to write a new app to apply the minimal imports (optionally ignoring Prelude, perhaps) generated automatically?For bonus points, it should also be possible to use the set of minimal imports across a project to add explicit export lists to each module using the minimal import lists.
Of course, weeder does some of this at the module level, but not the module contents level.
Presumably, this would help faster compilation and provide GHC with better optimization opportunities.
Undoubtedly the automatically-generated results would need hand tweaking, but I think that it might be a great help to some older code bases that have developed a certain amount of cruft that this sort of analysis could help improve. Doing it by hand, with a shell script or two would be one approach, but it would be good to have something a bit more robust (eg, preserving comments).
Perhaps someone has already done this.
The text was updated successfully, but these errors were encountered: