@@ -579,23 +579,11 @@ getCompletions
579
579
| Just (ImportHidingContext moduleName) <- maybeContext
580
580
= moduleImportListCompletions moduleName
581
581
582
- -- TODO: Is manual parsing ever needed or is context always present for module?
583
- -- If possible only keep the above.
584
- | " import " `T.isPrefixOf` fullLine
585
- , Just moduleName <- getModuleName fullLine
586
- , " (" `T.isInfixOf` fullLine
587
- = moduleImportListCompletions $ T. unpack moduleName
588
-
589
582
-- ------------------------------------------------------------------------
590
583
-- IMPORT MODULENAM|
591
584
| Just (ImportContext _moduleName) <- maybeContext
592
585
= filtImportCompls
593
586
594
- -- TODO: Can we avoid this manual parsing?
595
- -- If possible only keep the above.
596
- | " import " `T.isPrefixOf` fullLine
597
- = filtImportCompls
598
-
599
587
-- ------------------------------------------------------------------------
600
588
-- {-# LA| #-}
601
589
-- we leave this condition here to avoid duplications and return empty list
@@ -707,10 +695,6 @@ getCompletions
707
695
funs = map (show . name) $ HashSet. toList funcs
708
696
in filterModuleExports moduleName $ map T. pack funs
709
697
710
- -- manually parse in case we don't have completion context ("import [qualified ]ModuleName")
711
- getModuleName :: T. Text -> Maybe T. Text
712
- getModuleName line = filter (/= " qualified" ) (T. words line) !? 1
713
-
714
698
filtImportCompls :: [Scored CompletionItem ]
715
699
filtImportCompls = filtListWith (mkImportCompl enteredQual) importableModules
716
700
0 commit comments