haskell / hie-bios

Set up a GHC API session for various Haskell Projects
https://hackage.haskell.org/package/hie-bios
BSD 3-Clause "New" or "Revised" License
181 stars 63 forks source link

improve implicit cradle #422

Open wz1000 opened 1 year ago

wz1000 commented 1 year ago

Improve implicit cradles.

Try to match the behaviour of implicit-hie-cradle as closely as possible.

Elminates the need for implicit-hie-cradle and consolidates cradle selection logic into hie-bios.

  1. Prefer cabal over stack (all else being equal)
  2. Take work directories into account when making a decision
  3. Use implicit-hie to generate stack multi cradles

In particular, this differs from implicit-hie-cradle in that it uses default (cradle: cabal:) cradles for cabal.

However, we still generate implicit multi-cradles for stack projects by parsing the stack.yaml and *.cabal files

wz1000 commented 1 year ago

I've moved this into HLS proper: https://github.com/haskell/haskell-language-server/pull/3462/commits/178e54f8b2367ca47619081677d127fd3fa94c61

I change change this to deleting implicit cradle stuff from hie-bios.

michaelpj commented 11 months ago

Let's kill it!

jhrcek commented 9 months ago

@fendor If I understand this correctly, the logic from this PR now lives in hls: https://github.com/haskell/haskell-language-server/blob/master/ghcide/session-loader/Development/IDE/Session/Implicit.hs

So can this PR be closed then?

fendor commented 9 months ago

I think we wanted to remove the implicit cradle logic since we don't need it any more?

jhrcek commented 9 months ago

I can work on that if you give me some pointers, but in any case this PR looks like it's no longer relevant.

fendor commented 9 months ago

To remove the implicit cradle stuff, just start from https://github.com/haskell/hie-bios/pull/422/files#diff-58ae540d147057c94682a01b61de564caf1eb641fac8d2a3f29ea1f29d673ac4L316 and delete stuff until everything's green again :D