File tree Expand file tree Collapse file tree
plugins/hls-refactor-plugin/test Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2533,6 +2533,45 @@ deleteUnusedDefinitionTests = testGroup "delete unused definition action"
25332533 , " "
25342534 , " some = ()"
25352535 ]
2536+ , testSession " delete unused top level binding with Haddock comment" $
2537+ testFor
2538+ [ " {-# OPTIONS_GHC -Wunused-top-binds #-}"
2539+ , " module A (some) where"
2540+ , " "
2541+ , " -- | docs for f"
2542+ , " f :: Int"
2543+ , " f = 1"
2544+ , " "
2545+ , " some = ()"
2546+ ]
2547+ (5 , 0 )
2548+ 1
2549+ " Delete ‘f’"
2550+ [ " {-# OPTIONS_GHC -Wunused-top-binds #-}"
2551+ , " module A (some) where"
2552+ , " "
2553+ , " some = ()"
2554+ ]
2555+ , testSession " delete unused top level binding with block Haddock comment" $
2556+ testFor
2557+ [ " {-# OPTIONS_GHC -Wunused-top-binds #-}"
2558+ , " module A (some) where"
2559+ , " "
2560+ , " {-| docs for f"
2561+ , " -}"
2562+ , " f :: Int"
2563+ , " f = 1"
2564+ , " "
2565+ , " some = ()"
2566+ ]
2567+ (6 , 0 )
2568+ 1
2569+ " Delete ‘f’"
2570+ [ " {-# OPTIONS_GHC -Wunused-top-binds #-}"
2571+ , " module A (some) where"
2572+ , " "
2573+ , " some = ()"
2574+ ]
25362575 , testSession " delete unused binding in where clause" $
25372576 testFor
25382577 [ " {-# OPTIONS_GHC -Wunused-binds #-}"
You can’t perform that action at this time.
0 commit comments