haskell-language-server
haskell-language-server copied to clipboard
Rename a constructor renames all record fields
Your environment
Which OS do you use: Ubuntu 20.04 Which LSP client (editor/plugin) do you use: VS Code, Haskell extension v2.2.0, ghc 9.2.0, HLS 1.7.0.0 Describe your project (alternative: link to the project): A .yml parser.
Steps to reproduce
See commit 1
Next, try to rename Column
using the Rename action- commit 2
Expected behaviour
Only the constructor name is updated
Actual behaviour
All fields of a record are renamed the same as the new consructor name
Include debug information
Hi,
Thanks for the report!
Please could you update the link to the commit for the steps to reproduce? It looks like the repository might be private.
@br4ch1st0chr0n3
Hi, sorry for that. Should be public now, @OliverMadine.
It seems like the issue is hie files including record field names as references to the constructor. This is only happening with ghc >= 9.
@wz1000 maybe you have some more insight?
It seems like the issue is hie files including record field names as references to the constructor. This is only happening with ghc >= 9.
Is this a bug or a feature?
If it is a bug, we will need to report it in the GHC bug tracker and ideally contribute a fix. And back port the fixes to hie-compat: https://github.com/haskell/haskell-language-server/tree/master/hie-compat
Is this still a problem?
Yes. I've gotten bitten by this yesterday at least with HLS 2.5.0.0.
I've just tested and confirmed that it still occurs with HLS 2.6.0.0.