File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
ghcide/src/Development/IDE/Plugin Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -146,18 +146,11 @@ getCompletionsLSP lsp ide
146
146
let clientCaps = clientCapabilities $ shakeExtras ide
147
147
snippets <- WithSnippets . completionSnippetsOn <$> getClientConfig lsp
148
148
allCompletions <- getCompletions ideOpts cci' parsedMod bindMap pfix' clientCaps snippets
149
- let topCompletions = List $ take 20 allCompletions
150
- isComplete = allCompletions `longerThan` 20
151
- pure $ CompletionList (CompletionListType isComplete topCompletions)
149
+ let (topCompletions, rest) = splitAt maxCompletions allCompletions
150
+ pure $ CompletionList (CompletionListType (null rest) (List topCompletions))
152
151
_ -> return (Completions $ List [] )
153
152
_ -> return (Completions $ List [] )
154
153
_ -> return (Completions $ List [] )
155
-
156
- longerThan :: [a ] -> Int -> Bool
157
- longerThan [] _ = False
158
- longerThan _ 0 = True
159
- longerThan (_ : aa) n = longerThan aa (n - 1 )
160
-
161
154
setHandlersCompletion :: PartialHandlers Config
162
155
setHandlersCompletion = PartialHandlers $ \ WithMessage {.. } x -> return x{
163
156
LSP. completionHandler = withResponse RspCompletion getCompletionsLSP
You can’t perform that action at this time.
0 commit comments