From 2413f960600cfedd81c391cc668f9d8d4575f76d Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Mon, 2 May 2022 00:00:43 +0100 Subject: [PATCH 1/2] Prefer Data.HashSet.member to Data.Foldable.elem --- plugins/hls-rename-plugin/src/Ide/Plugin/Rename.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/hls-rename-plugin/src/Ide/Plugin/Rename.hs b/plugins/hls-rename-plugin/src/Ide/Plugin/Rename.hs index 16273d268b..1777872f2a 100644 --- a/plugins/hls-rename-plugin/src/Ide/Plugin/Rename.hs +++ b/plugins/hls-rename-plugin/src/Ide/Plugin/Rename.hs @@ -161,7 +161,7 @@ renameRefs newName refs = everywhere $ mkT replaceLoc replace _ = Unqual newName isRef :: SrcSpan -> Bool - isRef = (`elem` refs) . unsafeSrcSpanToLoc + isRef = (`HS.member` refs) . unsafeSrcSpanToLoc --------------------------------------------------------------------------------------------------- -- Reference finding From df72a86b9107dbbe20da4485fcc5f42104e2d69f Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Mon, 2 May 2022 00:00:58 +0100 Subject: [PATCH 2/2] Remove unused binding --- ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs | 1 - 1 file changed, 1 deletion(-) diff --git a/ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs b/ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs index 1e6675275d..ef2e13704b 100644 --- a/ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs +++ b/ghcide/src/Development/IDE/Plugin/CodeAction/ExactPrint.hs @@ -514,7 +514,6 @@ extendImportViaParent df parent child (L l it@ImportDecl{..}) listAnn = epAnn srcParent [AddEpAnn AnnOpenP (epl 1), AddEpAnn AnnCloseP (epl 0)] x :: LIE GhcPs = reLocA $ L l'' $ IEThingWith listAnn parentLIE NoIEWildcard [childLIE] - let hasSibling = not (null pre) lies' <- addCommaInImportList (reverse pre) x #endif return $ L l it{ideclHiding = Just (hide, L l' lies')}