Skip to content

Commit 22b27d6

Browse files
Rename pred to predicate to avoid name shadowing.
1 parent 0f09cae commit 22b27d6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

test/utils/Test/Hls/Util.hs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ fromCommand (CACommand command) = command
306306
fromCommand _ = error "Not a command"
307307

308308
onMatch :: [a] -> (a -> Bool) -> String -> IO a
309-
onMatch as pred err = maybe (fail err) return (find pred as)
309+
onMatch as predicate err = maybe (fail err) return (find predicate as)
310310

311311
inspectDiagnostic :: [Diagnostic] -> [T.Text] -> IO Diagnostic
312312
inspectDiagnostic diags s = onMatch diags (\ca -> all (`T.isInfixOf` (ca ^. L.message)) s) err
@@ -316,18 +316,18 @@ expectDiagnostic :: [Diagnostic] -> [T.Text] -> IO ()
316316
expectDiagnostic diags s = void $ inspectDiagnostic diags s
317317

318318
inspectCodeAction :: [CAResult] -> [T.Text] -> IO CodeAction
319-
inspectCodeAction cars s = fromAction <$> onMatch cars pred err
320-
where pred (CACodeAction ca) = all (`T.isInfixOf` (ca ^. L.title)) s
321-
pred _ = False
319+
inspectCodeAction cars s = fromAction <$> onMatch cars predicate err
320+
where predicate (CACodeAction ca) = all (`T.isInfixOf` (ca ^. L.title)) s
321+
predicate _ = False
322322
err = "expected code action matching '" ++ show s ++ "' but did not find one"
323323

324324
expectCodeAction :: [CAResult] -> [T.Text] -> IO ()
325325
expectCodeAction cars s = void $ inspectCodeAction cars s
326326

327327
inspectCommand :: [CAResult] -> [T.Text] -> IO Command
328-
inspectCommand cars s = fromCommand <$> onMatch cars pred err
329-
where pred (CACommand command) = all (`T.isInfixOf` (command ^. L.title)) s
330-
pred _ = False
328+
inspectCommand cars s = fromCommand <$> onMatch cars predicate err
329+
where predicate (CACommand command) = all (`T.isInfixOf` (command ^. L.title)) s
330+
predicate _ = False
331331
err = "expected code action matching '" ++ show s ++ "' but did not find one"
332332

333333
waitForDiagnosticsFrom :: TextDocumentIdentifier -> T.Session [Diagnostic]

0 commit comments

Comments
 (0)