mpickering / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2 stars 1 forks source link

Cabal-Helper: Select project context based on available tools #52

Closed fendor closed 5 years ago

fendor commented 5 years ago

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 and stack.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 no cabal-install, or stack, 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

fendor commented 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?

lukel97 commented 5 years ago

@fendor yup, this makes sense to me