Skip to content
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

Add code action to add unused function to export list #157

Closed
fendor opened this issue Jun 12, 2020 · 8 comments · Fixed by haskell/ghcide#711
Closed

Add code action to add unused function to export list #157

fendor opened this issue Jun 12, 2020 · 8 comments · Fixed by haskell/ghcide#711
Labels
type: enhancement New feature or request

Comments

@fendor
Copy link
Collaborator

fendor commented Jun 12, 2020

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

@fendor fendor added type: enhancement New feature or request good first issue labels Jun 12, 2020
@sureyeaah
Copy link
Contributor

sureyeaah commented Jun 15, 2020

Can I take this one? And will this be added in ghcide?

@fendor
Copy link
Collaborator Author

fendor commented Jun 16, 2020

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

@pepeiborra
Copy link
Collaborator

pepeiborra commented Jun 16, 2020

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.

@sureyeaah
Copy link
Contributor

sureyeaah commented Jul 26, 2020

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?

@sureyeaah
Copy link
Contributor

Merged in ghcide.

@lukel97
Copy link
Collaborator

lukel97 commented Jul 28, 2020

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

@sureyeaah
Copy link
Contributor

This has been merged in hls master.

@fendor
Copy link
Collaborator Author

fendor commented Sep 3, 2020

Closed by #348

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants