Skip to content

Commit 9e10a19

Browse files
committed
rename n to limit
1 parent 97eb2de commit 9e10a19

File tree

1 file changed

+6
-7
lines changed
  • ghcide/src/Development/IDE/Plugin

1 file changed

+6
-7
lines changed

ghcide/src/Development/IDE/Plugin/HLS.hs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -457,17 +457,17 @@ makeCompletions sps lf ideState params@(CompletionParams (TextDocumentIdentifier
457457
IO [Either ResponseError CompletionResponseResult]
458458
makeAction 0 _ = return []
459459
makeAction _ [] = return []
460-
makeAction n ((pid, p) : rest) = do
460+
makeAction limit ((pid, p) : rest) = do
461461
pluginConfig <- getPluginConfig lf pid
462462
results <- if pluginEnabled pluginConfig plcCompletionOn
463463
then otTracedProvider pid "completions" $ p lf ideState params
464464
else return $ Right $ Completions $ List []
465465
case results of
466466
Right resp -> do
467-
let (n', results') = consumeCompletionResponse n resp
468-
(Right results' :) <$> makeAction n' rest
467+
let (limit', results') = consumeCompletionResponse limit resp
468+
(Right results' :) <$> makeAction limit' rest
469469
Left err ->
470-
(Left err :) <$> makeAction n rest
470+
(Left err :) <$> makeAction limit rest
471471

472472
case mprefix of
473473
Nothing -> return $ Right $ Completions $ List []
@@ -479,9 +479,8 @@ makeCompletions sps lf ideState params@(CompletionParams (TextDocumentIdentifier
479479

480480
-- | Crops a completion response. Returns the final number of completions and the cropped response
481481
consumeCompletionResponse :: Int -> CompletionResponseResult -> (Int, CompletionResponseResult)
482-
consumeCompletionResponse n it@(CompletionList (CompletionListType _ (List xx))) =
483-
case splitAt n xx of
484-
(_, []) -> (n - length xx, it)
482+
consumeCompletionResponse limit it@(CompletionList (CompletionListType _ (List xx))) =
483+
case splitAt limit xx of
485484
(xx', _) -> (0, CompletionList (CompletionListType False (List xx')))
486485
consumeCompletionResponse n (Completions (List xx)) =
487486
consumeCompletionResponse n (CompletionList (CompletionListType False (List xx)))

0 commit comments

Comments
 (0)