Your environment
Which OS do you use? nixos
Which version of GHC do you use and how did you install it? 9.12.3, nixpkgs
How is your project built (alternative: link to the project)? single module
Which LSP client (editor/plugin) do you use? n/a
Which version of HLS do you use and how did you install it? 2.13.0.0, nixpkgs
Have you configured HLS in any way (especially: a hie.yaml file)?
Steps to reproduce
{-# LANGUAGE RecordWildCards #-}
module Rename where
data Foo = MkFoo {foo :: Int}
y = foo (MkFoo 2)
x = MkFoo {..}
where
foo = 3
when renaming foo to bar in the where clause on the last line, we get:
{-# LANGUAGE RecordWildCards #-}
module Rename where
data Foo = MkFoo {bar :: Int}
y = bar (MkFoo 2)
x = MkFoo {..}
where
bar = 3
which is a valid program but arguably not what the user might have intended (definitely not what I intended... ^^')
Expected behaviour
only the bar's scope should rename, i.e. resulting in an invalid program or (more complicated, inserting {foo = bar, ..} into the record wild card.
Debug information
I haven't tried on 2.14.0.0.
Your environment
Which OS do you use? nixos
Which version of GHC do you use and how did you install it? 9.12.3, nixpkgs
How is your project built (alternative: link to the project)? single module
Which LSP client (editor/plugin) do you use? n/a
Which version of HLS do you use and how did you install it? 2.13.0.0, nixpkgs
Have you configured HLS in any way (especially: a
hie.yamlfile)?Steps to reproduce
{-# LANGUAGE RecordWildCards #-} module Rename where data Foo = MkFoo {foo :: Int} y = foo (MkFoo 2) x = MkFoo {..} where foo = 3when renaming
footobarin thewhereclause on the last line, we get:{-# LANGUAGE RecordWildCards #-} module Rename where data Foo = MkFoo {bar :: Int} y = bar (MkFoo 2) x = MkFoo {..} where bar = 3which is a valid program but arguably not what the user might have intended (definitely not what I intended... ^^')
Expected behaviour
only the
bar's scope should rename, i.e. resulting in an invalid program or (more complicated, inserting{foo = bar, ..}into the record wild card.Debug information
I haven't tried on 2.14.0.0.