diff --git a/plugins/hls-refactor-plugin/src/Development/IDE/GHC/ExactPrint.hs b/plugins/hls-refactor-plugin/src/Development/IDE/GHC/ExactPrint.hs index 2cc7f68084..afb83f48af 100644 --- a/plugins/hls-refactor-plugin/src/Development/IDE/GHC/ExactPrint.hs +++ b/plugins/hls-refactor-plugin/src/Development/IDE/GHC/ExactPrint.hs @@ -514,11 +514,8 @@ insertAtStart' old newDecl = do insertDeclAtStart _ d ds = d : ds prependDeclToWhereDecls decl newWhereDecl = do - traceShowM "tag2" ds <- balanceCommentsList =<< hsDecls decl - traceShowM "tag3" let ds' = prependDecl (wrapDecl newWhereDecl) ds - traceShowM "tag4" replaceDecls decl ds' prependDecl :: LHsDecl GhcPs -> [LHsDecl GhcPs] -> [LHsDecl GhcPs] @@ -559,8 +556,8 @@ prependDecl ldecl = \case (L (SrcSpanAnn (EpAnn (Anchor d1Rss d1AncOp) d1Ann epaCs@(EpaCommentsBalanced [] _)) ss) d1) -> let ld1' = L (SrcSpanAnn (EpAnn (Anchor d1Rss $ MovedAnchor $ DifferentLine 1 0) d1Ann epaCs) ss) d1 in (d1AncOp, ld1') - L (SrcSpanAnn EpAnnNotUsed _) _ -> trace "tag6" error "Unexpected EpAnnNotUsed" - ldecl' = setEntryDP ldecl (maybe (trace "tag7" error "what to do with UnchangedAnchor?") id $ getAnchorOpDp ancOp) + L (SrcSpanAnn EpAnnNotUsed _) _ -> error "Unexpected EpAnnNotUsed" + ldecl' = setEntryDP ldecl (maybe (error "what to do with UnchangedAnchor?") id $ getAnchorOpDp ancOp) setAnchorDp :: Anchor -> DeltaPos -> Anchor setAnchorDp (Anchor rss _) dp = Anchor rss (MovedAnchor dp) diff --git a/plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs b/plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs index e6c6dc8e45..c0d8a5812a 100644 --- a/plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs +++ b/plugins/hls-refactor-plugin/src/Development/IDE/Plugin/CodeAction.hs @@ -1030,7 +1030,6 @@ addToWhere (ParsedModule _ parsedSource _ _) range name _typ = bimap traceShowId noLocA (Match newDeclMatchAnn (FunRhs (mkUnqual name) Prefix SrcStrict) [] grhss) newDeclMg = MG NoExtField (L (noAnnSrcSpanDP0 declMatchSrcSpan) [newDeclMatch]) Generated newDecl = (FunBind NoExtField (mkUnqual name) newDeclMg []) - traceShowM "tag1" prependDeclToWhereDecls match (noLocA newDecl) else pure match let decl' = L locDecl (ValD xVal (FunBind xFunBind idFunBind mg' coreFunBind)) diff --git a/plugins/hls-refactor-plugin/test/Main.hs b/plugins/hls-refactor-plugin/test/Main.hs index 54a3d629ed..f8a31420aa 100644 --- a/plugins/hls-refactor-plugin/test/Main.hs +++ b/plugins/hls-refactor-plugin/test/Main.hs @@ -2380,8 +2380,8 @@ addFunctionArgumentTests = addToWhereTests :: TestTree addToWhereTests = testGroup - "add_to_where" - [ testSession "insert_new_where" $ do + "add to where" + [ testSession "insert new where" $ do let foo = [ "module Foo where" , ""