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 support for non-standard cabal.project file locations to cabal cradles #357

Merged
merged 1 commit into from
May 11, 2023

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Aug 18, 2022

Add parser tests for non-standard cabal.project file locations
Add bios tests for projects with non-standard cabal.project file locations
Follows the same structure as stackYaml feature for stack cradles.

Fixes #263

Copy link
Contributor

@michaelpj michaelpj left a comment

Choose a reason for hiding this comment

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

Seems nice!

src/HIE/Bios/Config.hs Show resolved Hide resolved
projectLocationOrDefault :: CradleProjectConfig -> [FilePath]
projectLocationOrDefault = \case
NoExplicitConfig -> ["cabal.project", "cabal.project.local"]
(ExplicitConfig prjFile) -> [prjFile, prjFile <.> "local"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Should the explicit config include the .local file? Or will cabal pick it up automatically if it has the main project file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is used for cabal cradle dependencies, e.g. telling HLS that the cradle needs to be reloaded if either of the two changes. IIRC, that behaviour is in line with cabal.
However, the name is misleading.

src/HIE/Bios/Cradle.hs Outdated Show resolved Hide resolved
@Kleidukos
Copy link
Member

@fendor what's the status on this PR? Do you think you can spare some time to solve the conflicts / rebase it?

@fendor
Copy link
Collaborator Author

fendor commented May 8, 2023

@Kleidukos Sure, do you have a use-case for this feature?

@Kleidukos
Copy link
Member

@fendor I personally don't, but a post on the Discourse could certainly gauge the interest for this feature :)

@fendor fendor force-pushed the feature/cabal-project branch 2 times, most recently from 023067d to 1f8d512 Compare May 8, 2023 08:51
Add parser tests for cabal.project files
Add bios tests for cabal.project files
@michaelpj michaelpj merged commit 57db960 into haskell:master May 11, 2023
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.

Add project-file config option to cabal cradle
3 participants