File tree Expand file tree Collapse file tree 5 files changed +12
-5
lines changed
plugins/hls-rename-plugin Expand file tree Collapse file tree 5 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ packages:
88 ./hls-test-utils
99
1010
11- index-state : 2025-06-07T14:57 :40Z
11+ index-state : 2025-06-16T09:44 :13Z
1212
1313tests : True
1414test-show-details : direct
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ library
7575 , hashable
7676 , hie-bios ^>= 0.15.0
7777 , hie-compat ^>= 0.3.0.0
78- , hiedb ^>= 0.6 .0.2
78+ , hiedb ^>= 0.7 .0.0
7979 , hls-graph == 2.11.0.0
8080 , hls-plugin-api == 2.11.0.0
8181 , implicit-hie >= 0.1.4.0 && < 0.1.5
Original file line number Diff line number Diff line change @@ -407,7 +407,7 @@ library hls-call-hierarchy-plugin
407407 , containers
408408 , extra
409409 , ghcide == 2.11.0.0
410- , hiedb ^>= 0.6 .0.2
410+ , hiedb ^>= 0.7 .0.0
411411 , hls-plugin-api == 2.11.0.0
412412 , lens
413413 , lsp >= 2.7
@@ -594,7 +594,7 @@ library hls-rename-plugin
594594 , containers
595595 , ghcide == 2.11.0.0
596596 , hashable
597- , hiedb ^>= 0.6 .0.2
597+ , hiedb ^>= 0.7 .0.0
598598 , hie-compat
599599 , hls-plugin-api == 2.11.0.0
600600 , haskell-language-server :hls-refactor-plugin
Original file line number Diff line number Diff line change @@ -42,7 +42,9 @@ import qualified Development.IDE.GHC.ExactPrint as E
4242import Development.IDE.Plugin.CodeAction
4343import Development.IDE.Spans.AtPoint
4444import Development.IDE.Types.Location
45+ import HieDb ((:.) (.. ))
4546import HieDb.Query
47+ import HieDb.Types (RefRow (refIsGenerated ))
4648import Ide.Plugin.Error
4749import Ide.Plugin.Properties
4850import Ide.PluginUtils
@@ -196,6 +198,11 @@ refsAtName state nfp name = do
196198 dbRefs <- case nameModule_maybe name of
197199 Nothing -> pure []
198200 Just mod -> liftIO $ mapMaybe rowToLoc <$> withHieDb (\ hieDb ->
201+ -- GHC inserts `Use`s of record constructor everywhere where its record selectors are used,
202+ -- which leads to fields being renamed whenever corresponding constructor is renamed.
203+ -- see https://github.com/haskell/haskell-language-server/issues/2915
204+ -- To work around this, we filter out compiler-generated references.
205+ filter (\ (refRow HieDb. :. _) -> not $ refIsGenerated refRow) <$>
199206 findReferences
200207 hieDb
201208 True
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ goldenWithRename title path act =
113113 goldenWithHaskellDoc (def { plugins = M. fromList [(" rename" , def { plcConfig = " crossModule" .= True })] })
114114 renamePlugin title testDataDir path " expected" " hs" act
115115
116- renameExpectError :: ( TResponseError Method_TextDocumentRename ) -> TextDocumentIdentifier -> Position -> Text -> Session ()
116+ renameExpectError :: TResponseError Method_TextDocumentRename -> TextDocumentIdentifier -> Position -> Text -> Session ()
117117renameExpectError expectedError doc pos newName = do
118118 let params = RenameParams Nothing doc pos newName
119119 rsp <- request SMethod_TextDocumentRename params
You can’t perform that action at this time.
0 commit comments