Skip to content

Wrong rename type variables in type families #3716

Open
@deemp

Description

@deemp

Your environment

Which OS do you use?
Ubuntu 20.04

Which version of GHC do you use and how did you install it?
9.2.8 from github:NixOS/nixpkgs/ec322bf9e598a510995e7540f17af57ee0c8d5b9

How is your project built (alternative: link to the project)?
cabal build

Which LSP client (editor/plugin) do you use?
VSCode + vscode-haskell

Which version of HLS do you use and how did you install it?
haskell-language-server 2.0.0.0 from github:NixOS/nixpkgs/ec322bf9e598a510995e7540f17af57ee0c8d5b9

Have you configured HLS in any way (especially: a hie.yaml file)?
Nope

Steps to reproduce

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeFamilies #-}

module Data.Lens.Barlow.Rename () where

data MTag = A
data B a b c d e f

type family ClosedFamily s :: MTag where
  -- before
  ClosedFamily (B a b c d e f) = A

  -- after rename 'a' to 'a1'
  -- SelectTag (B a1b c d e f) = A

  -- after rename 'a' to 'a12'
  -- SelectTag (B a12bc d e f) = A

  -- after rename 'a' to 'a123'
  -- SelectTag (B a123bcd e f) = A

  -- etc., I guess

  -- after rename 'c' to 'c23'
  -- ClosedFamily (B a b c23de f) = A


type family OpenFamily s :: MTag

-- before
type instance OpenFamily (B a b c    d e f) = A

-- after rename 'a' to 'a1234'
-- type instance OpenFamily (B a1234bc  d e f) = A

Expected behaviour

Spaces between type variables are kept after a rename.

Actual behaviour

Spaces between subsequent type variables are removed.
The number of removed spaces depends on the length of the name of a parameter.

Debug information

Metadata

Metadata

Assignees

Labels

component: hls-rename-plugintype: 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