File tree Expand file tree Collapse file tree 2 files changed +17
-2
lines changed
lib/Language/Haskell/Stylish/Step Expand file tree Collapse file tree 2 files changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -323,11 +323,14 @@ printImport _ (IEModuleContents _ (L _ m)) = do
323323 putText " module"
324324 space
325325 putText (moduleNameString m)
326- printImport separateLists (IEThingWith _ name _wildcard imps _) = do
326+ printImport separateLists (IEThingWith _ name wildcard imps _) = do
327327 printIeWrappedName name
328328 when separateLists space
329+ let ellipsis = case wildcard of
330+ IEWildcard _position -> [putText " .." ]
331+ NoIEWildcard -> []
329332 parenthesize $
330- sep (comma >> space) (printIeWrappedName <$> imps)
333+ sep (comma >> space) (ellipsis <> fmap printIeWrappedName imps)
331334printImport _ (IEGroup _ _ _ ) =
332335 error " Language.Haskell.Stylish.Printer.Imports.printImportExport: unhandled case 'IEGroup'"
333336printImport _ (IEDoc _ _) =
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ tests = testGroup "Language.Haskell.Stylish.Printer.ModuleHeader"
3636 , testCase " Does not sort" ex16
3737 , testCase " Repects separate_lists" ex17
3838 , testCase " Indents absent export list with break_only_where" ex18
39+ , testCase " Respects bundled patterns" ex19
3940 ]
4041
4142--------------------------------------------------------------------------------
@@ -319,3 +320,14 @@ ex18 = assertSnippet (step defaultConfig {breakOnlyWhere = True})
319320 [ " module Foo"
320321 , " where"
321322 ]
323+
324+ ex19 :: Assertion
325+ ex19 = assertSnippet (step defaultConfig)
326+ [ " {-# LANGUAGE PatternSynonyms #-}"
327+ , " module Foo (Bar (.., Baz)) where"
328+ ]
329+ [ " {-# LANGUAGE PatternSynonyms #-}"
330+ , " module Foo"
331+ , " ( Bar (.., Baz)"
332+ , " ) where"
333+ ]
You can’t perform that action at this time.
0 commit comments