git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Don't warn for a single hiding import
1292c34Gary Burgess
src/Language/PureScript/Ide/Imports.hs+2−2
@@ -76,8 +76,8 @@ compImport (Import n i q) (Import n' i' q')
76 | compImportType i i' /= EQ = compImportType i i'
76 | compImportType i i' /= EQ = compImportType i i'
77 -- This means that for a stable sort, the first implicit import will stay
77 -- This means that for a stable sort, the first implicit import will stay
78 -- the first implicit import
78 -- the first implicit import
79− | P.isImplicit i && isNothing q = LT
79+ | not (P.isExplicit i) && isNothing q = LT
80− | P.isImplicit i && isNothing q' = GT
80+ | not (P.isExplicit i) && isNothing q' = GT
81 | otherwise = compare n n'
81 | otherwise = compare n n'
82
82
83-- | Reads a file and returns the (lines before the imports, the imports, the
83-- | Reads a file and returns the (lines before the imports, the imports, the
src/Language/PureScript/Linter/Imports.hs+1−1
@@ -190,7 +190,7 @@ lintImportDecl env mni qualifierName names declType allowImplicit =
190 Just q ->
190 Just q ->
191 let usedModuleNames = mapMaybe extractQualName names
191 let usedModuleNames = mapMaybe extractQualName names
192 in unless (q `elem` usedModuleNames) unused
192 in unless (q `elem` usedModuleNames) unused
193− Hiding _ -> checkImplicit HidingImport
193+ Hiding _ -> unless allowImplicit (checkImplicit HidingImport)
194 Explicit [] -> unused
194 Explicit [] -> unused
195 Explicit declrefs -> checkExplicit declrefs
195 Explicit declrefs -> checkExplicit declrefs
196
196