Skip to content

Renaming constructor makes undesirable whitespace changes / removal of .. from Record wildcard pattern matches {..} #4636

Open
@jhrcek

Description

@jhrcek

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

Debug information

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: needs triagetype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions