File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
plugins/hls-refactor-plugin
src/Development/IDE/Plugin Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -769,7 +769,7 @@ suggestExportUnusedTopBinding srcOpt ParsedModule{pm_parsed_source = L _ HsModul
769
769
770
770
printExport :: ExportsAs -> T. Text -> T. Text
771
771
printExport ExportName x = parenthesizeIfNeeds False x
772
- printExport ExportPattern x = " pattern " <> x
772
+ printExport ExportPattern x = " pattern " <> parenthesizeIfNeeds False x
773
773
printExport ExportFamily x = parenthesizeIfNeeds True x
774
774
printExport ExportAll x = parenthesizeIfNeeds True x <> " (..)"
775
775
Original file line number Diff line number Diff line change @@ -3413,6 +3413,19 @@ exportUnusedTests = testGroup "export unused actions"
3413
3413
, " module A (pattern Foo) where"
3414
3414
, " pattern Foo a <- (a, _)"
3415
3415
]
3416
+ , testSession " unused pattern synonym operator" $ template
3417
+ [ " {-# OPTIONS_GHC -Wunused-top-binds #-}"
3418
+ , " {-# LANGUAGE PatternSynonyms #-}"
3419
+ , " module A () where"
3420
+ , " pattern x :+ y = (x, y)"
3421
+ ]
3422
+ (R 3 0 3 12 )
3423
+ " Export ‘:+’"
3424
+ [ " {-# OPTIONS_GHC -Wunused-top-binds #-}"
3425
+ , " {-# LANGUAGE PatternSynonyms #-}"
3426
+ , " module A (pattern (:+)) where"
3427
+ , " pattern x :+ y = (x, y)"
3428
+ ]
3416
3429
, testSession " unused data type" $ template
3417
3430
[ " {-# OPTIONS_GHC -Wunused-top-binds #-}"
3418
3431
, " module A () where"
You can’t perform that action at this time.
0 commit comments