Avi-D-coder / implicit-hie

Auto generate a stack or cabal multi component hie.yaml file
BSD 3-Clause "New" or "Revised" License
201 stars 17 forks source link

Support curly braces #28

Open anka-213 opened 3 years ago

anka-213 commented 3 years ago

Cabal files apparently allows writing curly braces around blocks, which confuses implicit-hie. For example, this file: https://github.com/ivan-m/graphviz/blob/42dbb6312d7edf789d7055079de7b4fa099a4acc/graphviz.cabal#L59

Library {

-- ...

will generate a hie.yaml file like this

cradle:
  cabal:
    - path: "./"
      component: "graphviz:lib:{"

# ...

instead of the expected

cradle:
  cabal:
    - path: "./"
      component: "lib:graphviz"

# ...
Avi-D-coder commented 3 years ago

Is cabal indent insensitive within curly blocks?

anka-213 commented 3 years ago

What does index sensitive mean?

Avi-D-coder commented 3 years ago

oops, indent insensitive.

georgefst commented 3 years ago

Just hit this trying to load the Graphviz library in to HLS. No idea why it uses those braces, but, well, if Cabal accepts them...

Avi-D-coder commented 3 years ago

Unfortunately, I don't have any time to work on this in the next two weeks.

noughtmare commented 3 years ago

I ran into this with brittany: https://github.com/lspitzner/brittany/blob/4d064db674203626fe5011d10874fcbc335ec9b1/brittany.cabal#L47

Avi-D-coder commented 3 years ago

I'll take a look this weekend.