-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
WIP: Cabal helper loader #11
Conversation
Vastly copied from https://github.com/haskell/haskell-ide-engine/ Also, add a cabal flag to hide the cabal-helper dependency
<> "\n You may need to run stack build." | ||
pkgs <- catMaybes <$> mapM (nestedPkg pwd) (concat cfs) | ||
putStr <$> hieYaml name $ fmtPkgs name pkgs | ||
projM <- findCabalHelperEntryPoint $ pwd </> "Foo.hs" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is okay, but should be optional and behind the cabal-helper and command line flag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, it is a show-case, it should also not remove the old behaviour as it is waaaaaaaaayyy faster and should be the default mode. So, adding a cli would be sensible, imo, via optparse-applicative
env <- initialiseEnvironment p | ||
packages <- loadPackages env | ||
pkgs <- toHieYaml env packages | ||
let name = if | isCabalProject proj -> "cabal" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does the logic of isCabalProject
compare to | any (("dist-newstyle" ==)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is something to worry about for later. In this case, the project is decided based on the found files, e.g. cabal.project
, stack.yaml
and *.cabal
files. In this order, a project type is selected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At some point, we should take build directory into account first so the cabal-helper implicit logic marches the default logic and builds with the users preferred tool.
Closed as it seems like we want to go a different way |
Just for show-casing that integrating c-h is not that difficult.