Skip to content

Commit d38a8ff

Browse files
expipiplus1pepeiborra
authored andcommitted
Do not suggest explicit import lists for qualified imports (haskell#354)
1 parent 55293bd commit d38a8ff

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Ide/Plugin/ImportLens.hs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,16 @@ extractMinimalImports (Just (hsc)) (Just (tmrModule -> TypecheckedModule{..})) =
132132

133133
extractMinimalImports _ _ = return ([], Nothing)
134134

135-
-- | Given an import declaration, generate a code lens unless it has an explicit import list
135+
-- | Given an import declaration, generate a code lens unless it has an
136+
-- explicit import list or it's qualified
136137
generateLens :: PluginId -> Uri -> Map SrcLoc (ImportDecl GhcRn) -> LImportDecl GhcRn -> IO (Maybe CodeLens)
137138
generateLens pId uri minImports (L src imp)
138139
-- Explicit import list case
139140
| ImportDecl{ideclHiding = Just (False,_)} <- imp
140141
= return Nothing
142+
-- Qualified case
143+
| ImportDecl{ideclQualified = True} <- imp
144+
= return Nothing
141145
-- No explicit import list
142146
| RealSrcSpan l <- src
143147
, Just explicit <- Map.lookup (srcSpanStart src) minImports

0 commit comments

Comments
 (0)