Add library support for adding modules to components #8
+600
−33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added a target field to the config, which defines the field of the component to add the given values to.
The algorithms now adds values to the target field instead of always adding to
build-depends
.The
executeConfig
function can now be configured to add to different fields while the cli tool will still always use execute config forbuild-depends
.This would be very useful for HLS, as we want to use
cabal-add
as a library to be able to offer code actions to add unknown modules to cabal files in a project.Added some tests, verifying that modules can be added correctly with the right config.
If the previously written modules are separated by a space, instead of a comma, we currently don't extend accordingly, this is reflected in a test which currently fails.