apply-refact icon indicating copy to clipboard operation
apply-refact copied to clipboard

Apply hint: redundant lambda breaks block identation

Open jneira opened this issue 3 years ago • 10 comments

Hi, using hls-hlint-plugin an user has detected that apply "redundant lambda" breaks the block identantion.

Same versions that previous issues: #93 and #94

Test cases has been aded by @soiamsoNG: #92

jneira avatar Nov 13 '20 22:11 jneira

Thanks for reporting the bug. This one seems tricky to fix without modifying ghc-exactprint. See https://github.com/alanz/ghc-exactprint/issues/97.

Worst can we can disable refactoring of this hint in HLint.

zliu41 avatar Nov 14 '20 21:11 zliu41

I've disabled refactoring for this hint, if the body is an HsCase. https://github.com/ndmitchell/hlint/pull/1171 @jneira I can make a release of 0.9.0.0 now. Do you see anything else that needs to be included in the release?

zliu41 avatar Nov 23 '20 04:11 zliu41

@zliu41 The unique thing i would like to fix is the hardcoded path to the ghc libdir induced by ghc-exactprint: https://github.com/alanz/ghc-exactprint/issues/96 (although i am not totally sure at 100% that it is the cause) I am afraid it supposes a non trivial change in ghc-exactprint.

Otoh i have a hls branch that already uses apply-refact master that compiles (but not tested) so the actual api is usable by hls: https://github.com/haskell/haskell-language-server/compare/master...jneira:apply-refact-exts. I hope at least the interface would not need to be changed. :crossed_fingers:

So yeah, a release lo leverage your late amazing work here would be great.

jneira avatar Nov 23 '20 11:11 jneira

@zliu41 I am afraid the workaround for the ghc libdir hardcoded path in windows has become almost unnaceptable. I have to fix it asap and it will suppose changes in ghc-exactprint (i'll try to make it backwards compatible to no break other packages) and here. What do you think in wait to fix #87 and the hardcoded path before a release? If you think actual changes worths a independent release i will be fine too.

jneira avatar Nov 24 '20 06:11 jneira

Yeah, I'd like to fix #87 before a release. And perhaps more importantly, if https://github.com/alanz/ghc-exactprint/issues/96 needs to be fixed, I should wait for that too, because apply-refact calls ghcWrapper, so it needs to be changed to whatever the fixed version is.

zliu41 avatar Nov 24 '20 07:11 zliu41

@zliu41 hi! i've falmost finished the pr in hls to leverage your nice last changes. However dont know when i will be able to tacke https://github.com/alanz/ghc-exactprint/issues/96. What do you think about make a release with the actual version? I could use master in the pr but i would prefer to use a released version (no problem if you think is better to wait)

jneira avatar Jan 12 '21 10:01 jneira

@jneira Yeah, I think a release is due. The issue we were discussing before (#87), it seems best to be fixed in ghc-exactprint.

There are two more issues I'd like to take a look to see if they can be easily fixed: https://github.com/ndmitchell/hlint/issues/1179 and https://github.com/alanz/ghc-exactprint/issues/97. But I'll definitely make a release this week.

zliu41 avatar Jan 13 '21 06:01 zliu41

@jneira 0.9.0.0 is out :slightly_smiling_face:

zliu41 avatar Jan 16 '21 07:01 zliu41

@zliu41 hi! any progress in this issue? thanks

jneira avatar Jan 31 '22 10:01 jneira

Hi @jneira! I haven't looked at this one since a year ago :smile: . I think this requires some changes to ghc-exactprint, which I'm happy to look into soon, but I don't know how easy it is to fix it so I don't have an ETA.

zliu41 avatar Feb 04 '22 04:02 zliu41