Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ suggestExportUnusedTopBinding srcOpt ParsedModule{pm_parsed_source = L _ HsModul

printExport :: ExportsAs -> T.Text -> T.Text
printExport ExportName x = parenthesizeIfNeeds False x
printExport ExportPattern x = "pattern " <> x
printExport ExportPattern x = "pattern " <> parenthesizeIfNeeds False x
printExport ExportFamily x = parenthesizeIfNeeds True x
printExport ExportAll x = parenthesizeIfNeeds True x <> "(..)"

Expand Down
13 changes: 13 additions & 0 deletions plugins/hls-refactor-plugin/test/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -3413,6 +3413,19 @@ exportUnusedTests = testGroup "export unused actions"
, "module A (pattern Foo) where"
, "pattern Foo a <- (a, _)"
]
, testSession "unused pattern synonym operator" $ template
[ "{-# OPTIONS_GHC -Wunused-top-binds #-}"
, "{-# LANGUAGE PatternSynonyms #-}"
, "module A () where"
, "pattern x :+ y = (x, y)"
]
(R 3 0 3 12)
"Export ‘:+’"
[ "{-# OPTIONS_GHC -Wunused-top-binds #-}"
, "{-# LANGUAGE PatternSynonyms #-}"
, "module A (pattern (:+)) where"
, "pattern x :+ y = (x, y)"
]
, testSession "unused data type" $ template
[ "{-# OPTIONS_GHC -Wunused-top-binds #-}"
, "module A () where"
Expand Down
Loading