Description
After fixing #2915 in #4635 I noticed the following issues when RecordWildcard pattern matches are used and record constructor is renamed.
This issue seems to only affect GHC 9.6 and 9.8 (in 9.10+ it works fine).
Your environment
Which OS do you use?
Which version of GHC do you use and how did you install it?
How is your project built (alternative: link to the project)?
Which LSP client (editor/plugin) do you use?
VSCode
Which version of HLS do you use and how did you install it?
2.10.0.0 + latest changes from master
Have you configured HLS in any way (especially: a hie.yaml
file)?
No
Steps to reproduce
See reproducer marked as broken in https://github.com/haskell/haskell-language-server/pull/4635/files#diff-ecd5eff03edc6cac02343f9fe14aeb61fa616f9069e4b3db048d13affb648d17R29-R31
Expected behaviour
When renaming constructor, wildcard pattern matches should not be touched:
OriginalConstructor {..} -> RenamedConstructorToLongerName {..}
OriginalConstructor {..} -> ShortRenmd {..}
Actual behaviour
2 cases of issues happen when renaming the constructor:
OriginalConstructor {..} -> RenamedConstructorToLongerName{} -- notice that `..` are removed
OriginalConstructor {..} -> ShortRenmd { ..} -- undesirable whitespace is introduced