@@ -283,7 +283,7 @@ codeActionProvider plId docId _ context = do
283283 :: SearchStyle -> [ImportDiagnostic ] -> IdeM [J. CodeAction ]
284284 importActionsForTerms style importDiagnostics = do
285285 let searchTerms = map (applySearchStyle style . term) importDiagnostics
286- searchResults <- mapM Hoogle. searchModules searchTerms
286+ searchResults <- mapM Hoogle. searchModules' searchTerms
287287 let importTerms = zip searchResults importDiagnostics
288288 concat <$> mapM (uncurry (termToActions style)) importTerms
289289
@@ -311,9 +311,9 @@ codeActionProvider plId docId _ context = do
311311 -- no import list can be offered, since the function name
312312 -- may be not the one we expect.
313313 termToActions
314- :: SearchStyle -> [ModuleName ] -> ImportDiagnostic -> IdeM [J. CodeAction ]
314+ :: SearchStyle -> [( ModuleName , SymbolName ) ] -> ImportDiagnostic -> IdeM [J. CodeAction ]
315315 termToActions style modules impDiagnostic =
316- concat <$> mapM (importModuleAction style impDiagnostic) modules
316+ concat <$> mapM (uncurry ( importModuleAction style impDiagnostic) ) modules
317317
318318 -- | Creates various import actions for a module and the diagnostic.
319319 -- Possible import actions depend on the type of the symbol to import.
@@ -322,8 +322,8 @@ codeActionProvider plId docId _ context = do
322322 -- Thus, it may return zero, one or multiple import actions for a module.
323323 -- List of import actions does contain no duplicates.
324324 importModuleAction
325- :: SearchStyle -> ImportDiagnostic -> ModuleName -> IdeM [J. CodeAction ]
326- importModuleAction searchStyle impDiagnostic moduleName =
325+ :: SearchStyle -> ImportDiagnostic -> ModuleName -> SymbolName -> IdeM [J. CodeAction ]
326+ importModuleAction searchStyle impDiagnostic moduleName symbolTerm =
327327 catMaybes <$> sequenceA codeActions
328328 where
329329 importListActions :: [IdeM (Maybe J. CodeAction )]
@@ -339,23 +339,23 @@ codeActionProvider plId docId _ context = do
339339 -- import only this function
340340 Symbol
341341 -> [ mkImportAction moduleName impDiagnostic . Just . Only
342- <$> symName (term impDiagnostic)
342+ <$> symName symbolTerm
343343 ]
344344 -- Constructors can be imported in two ways, either all
345345 -- constructors of a type or only a subset.
346346 -- We can only import a single constructor at a time though.
347347 Constructor
348348 -> [ mkImportAction moduleName impDiagnostic . Just . AllOf
349- <$> datatypeName (term impDiagnostic)
349+ <$> datatypeName symbolTerm
350350 , (\ dt sym -> mkImportAction moduleName impDiagnostic . Just
351351 $ OneOf dt sym)
352- <$> datatypeName (term impDiagnostic)
353- <*> symName (term impDiagnostic)
352+ <$> datatypeName symbolTerm
353+ <*> symName symbolTerm
354354 ]
355355 -- If we are looking for a type, import it as just a symbol
356356 Type
357357 -> [ mkImportAction moduleName impDiagnostic . Just . Only
358- <$> symName (term impDiagnostic) ]
358+ <$> symName symbolTerm ]
359359
360360 -- | All code actions that may be available
361361 -- Currently, omits all
0 commit comments