Skip to content

Commit

Permalink
Do not suggest explicit import lists for qualified imports (haskell#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
expipiplus1 authored and pepeiborra committed Sep 6, 2020
1 parent 55293bd commit d38a8ff
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Ide/Plugin/ImportLens.hs
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,16 @@ extractMinimalImports (Just (hsc)) (Just (tmrModule -> TypecheckedModule{..})) =

extractMinimalImports _ _ = return ([], Nothing)

-- | Given an import declaration, generate a code lens unless it has an explicit import list
-- | Given an import declaration, generate a code lens unless it has an
-- explicit import list or it's qualified
generateLens :: PluginId -> Uri -> Map SrcLoc (ImportDecl GhcRn) -> LImportDecl GhcRn -> IO (Maybe CodeLens)
generateLens pId uri minImports (L src imp)
-- Explicit import list case
| ImportDecl{ideclHiding = Just (False,_)} <- imp
= return Nothing
-- Qualified case
| ImportDecl{ideclQualified = True} <- imp
= return Nothing
-- No explicit import list
| RealSrcSpan l <- src
, Just explicit <- Map.lookup (srcSpanStart src) minImports
Expand Down

0 comments on commit d38a8ff

Please sign in to comment.