File tree 4 files changed +228
-191
lines changed
4 files changed +228
-191
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ library
61
61
, text
62
62
, text-rope
63
63
, unordered-containers >= 0.2.10.0
64
+ , haskeline
64
65
65
66
hs-source-dirs : src
66
67
default-language : Haskell2010
@@ -82,3 +83,4 @@ test-suite tests
82
83
, lsp-types
83
84
, tasty-hunit
84
85
, text
86
+
Original file line number Diff line number Diff line change @@ -275,18 +275,16 @@ completion _ide _ complParams = do
275
275
fmap (Right . J. InL ) $ case (contents, uriToFilePath' uri) of
276
276
(Just cnts, Just _path) -> do
277
277
pref <- VFS. getCompletionPrefix position cnts
278
- return $ result pref cnts
278
+ liftIO $ result pref cnts
279
279
_ -> return $ J. List []
280
280
where
281
- result :: Maybe VFS. PosPrefixInfo -> VirtualFile -> J. List CompletionItem
282
- result Nothing _ = J. List []
281
+ result :: Maybe VFS. PosPrefixInfo -> VirtualFile -> IO ( J. List CompletionItem )
282
+ result Nothing _ = pure $ J. List []
283
283
result (Just pfix) cnts
284
- | pos ^. JL. line == 0 = case context of
285
- Just (_, kw)
286
- | KeyWord _ <- kw -> J. List $ map buildCompletion $ snd cabalVersionKeyword
287
- _ -> J. List [buildCompletion (fst cabalVersionKeyword)]
288
- | Just ctx <- context = J. List $ makeCompletionItems pfix (getCompletionsForContext ctx)
289
- | otherwise = J. List []
284
+ | Just ctx <- context = do
285
+ completions <- contextToCompleter ctx
286
+ pure $ J. List $ makeCompletionItems pfix completions
287
+ | otherwise = pure $ J. List []
290
288
where
291
289
pos = VFS. cursorPos pfix
292
290
context = getContext pos (Rope. lines $ cnts ^. VFS. file_text)
You can’t perform that action at this time.
0 commit comments