visual-studio-codehaskell

How to use `rename` in haskell extention for VSCode?


I see that haskell extention supports renaming.

I normally rename in other languages by pressing F2. But if I try to do it in Haskell code - nothing happens.

If I try to press Refactor.. from local menu then VSCode outputs No refactorings available.

HLS works normally - highlights errors/warnings.

I tried to enable/disable Experimental cross-module renaming - nothing changes.

I ensured that Enables rename plugin in on.

I use Windows 10.


Solution

  • I just checked this on my machine and it didn't work at first, but here's how I was able to fix it:

    After changing these two settings, the basic functionality worked (F2 should show the rename dialog), but there's a catch in that HLS does not support cross-module renaming by default. Make sure you use an explicit export list and only rename things that are not on that list, or check out the renaming plugin documentation and try your luck at the experimental cross-module rename support.