Fix end-of-decl comment spacing issue
parent
5e5433f33a
commit
48522b596c
|
@ -1066,3 +1066,9 @@ func = func (abc) (def)
|
||||||
#expected
|
#expected
|
||||||
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
-- brittany { lconfig_operatorParenthesisRefactorMode: PRMMinimize }
|
||||||
func = func abc def
|
func = func abc def
|
||||||
|
|
||||||
|
#test wandering comment at end of datadecl
|
||||||
|
data ReformatParenMode
|
||||||
|
= ReformatParenModeKeep -- don't modify parens at all
|
||||||
|
| ReformatParenModeClean -- remove unnecessary parens
|
||||||
|
| ReformatParenModeAll -- add superfluous parens everywhere
|
||||||
|
|
|
@ -184,15 +184,18 @@ processModule traceFunc conf inlineConf moduleElems = do
|
||||||
|
|
||||||
commentToDoc :: (Int, EpaCommentTok) -> ToBriDocM BriDocNumbered
|
commentToDoc :: (Int, EpaCommentTok) -> ToBriDocM BriDocNumbered
|
||||||
commentToDoc (indent, c) = case c of
|
commentToDoc (indent, c) = case c of
|
||||||
GHC.EpaDocCommentNext str -> docLitS (replicate indent ' ' ++ str)
|
GHC.EpaDocCommentNext str -> handle str
|
||||||
GHC.EpaDocCommentPrev str -> docLitS (replicate indent ' ' ++ str)
|
GHC.EpaDocCommentPrev str -> handle str
|
||||||
GHC.EpaDocCommentNamed str -> docLitS (replicate indent ' ' ++ str)
|
GHC.EpaDocCommentNamed str -> handle str
|
||||||
GHC.EpaDocSection _ str -> docLitS (replicate indent ' ' ++ str)
|
GHC.EpaDocSection _ str -> handle str
|
||||||
GHC.EpaDocOptions str -> docLitS (replicate indent ' ' ++ str)
|
GHC.EpaDocOptions str -> handle str
|
||||||
GHC.EpaLineComment str -> docLitS (replicate indent ' ' ++ str)
|
GHC.EpaLineComment str -> handle str
|
||||||
GHC.EpaBlockComment str -> docLitS (replicate indent ' ' ++ str)
|
GHC.EpaBlockComment str -> handle str
|
||||||
GHC.EpaEofComment -> docEmpty
|
GHC.EpaEofComment -> docEmpty
|
||||||
|
where
|
||||||
|
handle str = if indent == 0
|
||||||
|
then docLitS str
|
||||||
|
else docSeq [docSeparator, docLitS $ (replicate (indent - 1) ' ') ++ str ]
|
||||||
|
|
||||||
-- Prints the information associated with the module annotation
|
-- Prints the information associated with the module annotation
|
||||||
-- This includes the imports
|
-- This includes the imports
|
||||||
|
|
Loading…
Reference in New Issue