haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

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

Open VeryMilkyJoe opened this issue 8 months ago • 3 comments

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 :) )

https://github.com/user-attachments/assets/e3055dcb-c652-4d2e-879c-7ca154214a4c

VeryMilkyJoe avatar Jun 07 '25 15:06 VeryMilkyJoe

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

Bodigrim avatar Jun 13 '25 19:06 Bodigrim

@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 :)

VeryMilkyJoe avatar Jun 16 '25 14:06 VeryMilkyJoe

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

Bodigrim avatar Jun 16 '25 20:06 Bodigrim

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

VeryMilkyJoe avatar Aug 06 '25 14:08 VeryMilkyJoe