Skip to content

Commit 5898472

Browse files
committed
refactor
1 parent 6d0a6f2 commit 5898472

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

plugins/hls-explicit-record-fields-plugin/src/Ide/Plugin/ExplicitFields.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ codeActionProvider ideState _ (CodeActionParams _ _ docId range _) = do
145145
let actions = map (mkCodeAction enabledExtensions) (RangeMap.filterByRange range crCodeActions)
146146
pure $ InL actions
147147
where
148-
mkCodeAction :: [Extension] -> Int -> Command |? CodeAction
148+
mkCodeAction :: [Extension] -> Int -> Command |? CodeAction
149149
mkCodeAction exts uid = InR CodeAction
150150
{ _title = mkTitle exts
151151
, _kind = Just CodeActionKind_RefactorRewrite
@@ -186,14 +186,14 @@ inlayHintProvider _ state pId InlayHintParams {_textDocument = TextDocumentIdent
186186
, uid <- RangeMap.elementsInRange range crCodeActions
187187
, Just record <- [IntMap.lookup uid crCodeActionResolve] ]
188188
-- Get the definition of each dotdot of record
189-
locations = [ getDefinition nfp pos
189+
locations = [ fmap (,record) (getDefinition nfp pos)
190190
| record <- records
191191
, pos <- maybeToList $ fmap _start $ recordInfoToDotDotRange record ]
192192
defnLocsList <- lift $ sequence locations
193-
pure $ InL $ mapMaybe (mkInlayHints crr pragma) (zip defnLocsList records)
193+
pure $ InL $ mapMaybe (mkInlayHint crr pragma) defnLocsList
194194
where
195-
mkInlayHints :: CollectRecordsResult -> NextPragmaInfo -> (Maybe [(Location, Identifier)], RecordInfo) -> Maybe InlayHint
196-
mkInlayHints CRR {enabledExtensions, nameMap} pragma (defnLocs, record) =
195+
mkInlayHint :: CollectRecordsResult -> NextPragmaInfo -> (Maybe [(Location, Identifier)], RecordInfo) -> Maybe InlayHint
196+
mkInlayHint CRR {enabledExtensions, nameMap} pragma (defnLocs, record) =
197197
let range = recordInfoToDotDotRange record
198198
textEdits = maybeToList (renderRecordInfoAsTextEdit nameMap record)
199199
<> maybeToList (pragmaEdit enabledExtensions pragma)

0 commit comments

Comments
 (0)