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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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! (It would be great to have a cabal-add release, so we don't have to have a source-repository :) )

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

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.
We need to depend on a newer commit of cabal-add since the newest
release does not yet allow us to add modules to a cabal-file.

Once there is a new release of cabal-add we can revert this commit.
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.

1 participant