Skip to content

Add Code Action for adding a module to your project's cabal file #4617

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

Merged
merged 1 commit into from
Aug 7, 2025

Conversation

VeryMilkyJoe
Copy link
Collaborator

@VeryMilkyJoe VeryMilkyJoe commented Jun 7, 2025

For diagnostics complaining about the current haskell module being unknown, we now offer all possible code actions to add the module to a field in the responsible cabal file.

Additionally, this PR refactors the cabal-plugin into smaller modules and also refactors the add-package feature to have some shared functions to be used for both add-package and add-module.

Thank you to @Bodigrim for the changes in cabal-add that made it possible to implement this feature without a huge amount of pain!

Screencast.From.2025-06-07.17-49-54.mp4

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch 3 times, most recently from 61bf7ee to 16bef12 Compare June 8, 2025 08:50
@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch from 16bef12 to 234cb09 Compare June 9, 2025 14:14
@Bodigrim
Copy link
Contributor

@VeryMilkyJoe please upgrade to the latest commit of cabal-add, Bodigrim/cabal-add@d831980. Once you confirm that it works well, I'll make a release.

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch 2 times, most recently from c40661e to 56144e4 Compare June 16, 2025 09:44
@VeryMilkyJoe
Copy link
Collaborator Author

@VeryMilkyJoe please upgrade to the latest commit of cabal-add, Bodigrim/cabal-add@d831980. Once you confirm that it works well, I'll make a release.

Done and all tests that matter are green :)

@Bodigrim
Copy link
Contributor

@VeryMilkyJoe here you go: https://hackage.haskell.org/package/cabal-add-0.2

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch from 56144e4 to 6a950f1 Compare June 17, 2025 15:10
@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch 6 times, most recently from c93ce2a to 47a6dca Compare July 9, 2025 14:42
@VeryMilkyJoe
Copy link
Collaborator Author

In my opinion, this is in a merge ready state, unless anyone wants to look over it again 🙃 @fendor?

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch 4 times, most recently from c508085 to ec0b496 Compare August 7, 2025 09:37
Copy link
Collaborator

@fendor fendor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, final cleanup round

@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch from ec0b496 to b2cfba6 Compare August 7, 2025 16:06
For diagnostics complaining about the current module being unknown,
we now offer code actions to add the module to any possible field in
the responsible cabal file.

Additionally, refactor the cabal-plugin into smaller modules and
refactor the add-package feature to have some shared functions to be
used for both add-package and add-module.
@VeryMilkyJoe VeryMilkyJoe force-pushed the feature/cabal-add-module branch from b2cfba6 to 5876af4 Compare August 7, 2025 16:13
@fendor fendor merged commit 4d309d5 into haskell:master Aug 7, 2025
36 checks passed
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

Successfully merging this pull request may close these issues.

3 participants