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

Pass package dependency information to Fourmolu #3165

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

georgefst
Copy link
Collaborator

@georgefst georgefst commented Sep 15, 2022

HLS 1.8 finally picks up Fourmolu > 0.7. In fact it ships with 0.8 on all GHC versions.

Unfortunately this causes a regression in recognising operator fixities for packages whose fixities were previously hardcoded. At least in environments with no Cabal file. I hit this with SBV, within seconds of installing the new HLS version.

This current implementation feels like a total hack. I could do with suggestions.

TODO

  • get fixities from env directly, rather than even having to read cabal file? this may be the key to doing this robustly
  • implement this for Ormolu
  • wrap version CPP around cfgDependencies, putting it in Shim.hs
  • check compatiblity across GHC API versions - given this involves units, I'd expect the API used to have changed in 9.4
  • regression test
  • maybe combine noCabal and packages in to a single option, seeing as they're closely related and introduced in the same version of Fourmolu

This helps it to determine fixity information, particularly in the absence of a Cabal file.
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