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:
8
8
./hls-test-utils
9
9
10
10
11
- index-state : 2025-06-07T14:57 :40Z
11
+ index-state : 2025-06-16T09:44 :13Z
12
12
13
13
tests : True
14
14
test-show-details : direct
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ library
75
75
, hashable
76
76
, hie-bios ^>= 0.15.0
77
77
, hie-compat ^>= 0.3.0.0
78
- , hiedb ^>= 0.6 .0.2
78
+ , hiedb ^>= 0.7 .0.0
79
79
, hls-graph == 2.11.0.0
80
80
, hls-plugin-api == 2.11.0.0
81
81
, 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
407
407
, containers
408
408
, extra
409
409
, ghcide == 2.11.0.0
410
- , hiedb ^>= 0.6 .0.2
410
+ , hiedb ^>= 0.7 .0.0
411
411
, hls-plugin-api == 2.11.0.0
412
412
, lens
413
413
, lsp >= 2.7
@@ -594,7 +594,7 @@ library hls-rename-plugin
594
594
, containers
595
595
, ghcide == 2.11.0.0
596
596
, hashable
597
- , hiedb ^>= 0.6 .0.2
597
+ , hiedb ^>= 0.7 .0.0
598
598
, hie-compat
599
599
, hls-plugin-api == 2.11.0.0
600
600
, 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
42
42
import Development.IDE.Plugin.CodeAction
43
43
import Development.IDE.Spans.AtPoint
44
44
import Development.IDE.Types.Location
45
+ import HieDb ((:.) (.. ))
45
46
import HieDb.Query
47
+ import HieDb.Types (RefRow (refIsGenerated ))
46
48
import Ide.Plugin.Error
47
49
import Ide.Plugin.Properties
48
50
import Ide.PluginUtils
@@ -196,6 +198,11 @@ refsAtName state nfp name = do
196
198
dbRefs <- case nameModule_maybe name of
197
199
Nothing -> pure []
198
200
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) <$>
199
206
findReferences
200
207
hieDb
201
208
True
Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ goldenWithRename title path act =
113
113
goldenWithHaskellDoc (def { plugins = M. fromList [(" rename" , def { plcConfig = " crossModule" .= True })] })
114
114
renamePlugin title testDataDir path " expected" " hs" act
115
115
116
- renameExpectError :: ( TResponseError Method_TextDocumentRename ) -> TextDocumentIdentifier -> Position -> Text -> Session ()
116
+ renameExpectError :: TResponseError Method_TextDocumentRename -> TextDocumentIdentifier -> Position -> Text -> Session ()
117
117
renameExpectError expectedError doc pos newName = do
118
118
let params = RenameParams Nothing doc pos newName
119
119
rsp <- request SMethod_TextDocumentRename params
You can’t perform that action at this time.
0 commit comments