Closed fendor closed 5 years ago
@bubba This is what I meant with "Check, if the user has the build-tools on the Path, before selecting a project type" in https://github.com/mpickering/haskell-ide-engine/issues/48#issuecomment-554747675. Do you want to tackle this?
@fendor yup, this makes sense to me
Our usage of c-h (cabal-helper) works roughly the following: Find a project context, initialise the context, find cradle for a filepath and load it. The first step, find a project context, decides the the project context based on the location of a
cabal.project
,stack.yaml
and*.cabal
files. If there is a tie, e.g.cabal.project
andstack.yaml
are found in the same directory, we do not specify whether this a cabal-v2 project or a stack project but rather let the implementation decide. Practically, due to the implementation in c-h, we prefer cabal-v2 over stack. However, it is possible that users have only one of the two installed, not both, thus, we can specify that if you have nocabal-install
, orstack
, installed, we never select a cabal-v2 project, or stack project, respectively.Responsible code is the function: https://github.com/mpickering/haskell-ide-engine/blob/dcf81a11d27171aae2197c7a9d903e106aa28b07/hie-plugin-api/Haskell/Ide/Engine/Cradle.hs#L110