When you have an unused function and an explicit export list in your module it would make sense to offer a code action to add the function to the explicit export list!
Implementation could be done similar to the code in: https://github.com/digital-asset/ghcide/blob/master/src/Development/IDE/Plugin/CodeAction.hs#L140
Can I take this one? And will this be added in ghcide?
@sureyeaah Please do!
IIRC, @pepeiborra said that this feature should be added to ghcide.
I think it will be easier in ghcide, as there is example code, and you dont have to understand the plugin system of HLS yet.
In my opinion, either is fine and can be moved to either project if necessary.
The path of least resistance would be ghcide, because that's where all the code actions currently live. Indeed, some of the more heavy weight code actions in ghcide, like the Suggest Imports one, should probably be extracted as HLS plugins too.
So I'm handling top level variable definitions, newtype/data types/type classeswhile exporting all(e.g. X(..)), type synonyms and pattern synonyms. I'm not dealing with constructors explicitly since that would involve finding the corresponding type in the export list. Thoughts?
Merged in ghcide.
You can make a PR to hls to cherry-pick the changes on top of the ghcide submodule, or wait until we eventually get it synced back up with digital-asset/master
This has been merged in hls master.
Closed by #348
Most helpful comment
Merged in ghcide.