File tree Expand file tree Collapse file tree 6 files changed +36
-3
lines changed Expand file tree Collapse file tree 6 files changed +36
-3
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ import Language.Haskell.GHC.ExactPrint.Utils (mkComment)
25
25
genForDataDecl :: GenComments
26
26
genForDataDecl =
27
27
GenComments {
28
- title = " Generate fields comments" ,
28
+ title = " Generate haddock comments" ,
29
29
updateAnns = updateDataAnns
30
30
}
31
31
Original file line number Diff line number Diff line change @@ -30,9 +30,11 @@ tests =
30
30
goldenWithHaddockComments " MultivariateFunction" Signature 4 8 ,
31
31
goldenWithHaddockComments " QualFunction" Signature 2 10 ,
32
32
goldenWithHaddockComments " Record" Record 7 2 ,
33
+ goldenWithHaddockComments " Record2" Record 3 6 ,
34
+ goldenWithHaddockComments " InlineRecord" Record 3 20 ,
33
35
expectedNothing " ConstFunction" Signature 2 2 ,
34
36
expectedNothing " StaleFunction" Signature 3 3 ,
35
- expectedNothing " StaleRecord" Record 3 12
37
+ expectedNothing " StaleRecord" Record 4 9
36
38
]
37
39
38
40
goldenWithHaddockComments :: FilePath -> GenCommentsType -> UInt -> UInt -> TestTree
@@ -54,7 +56,7 @@ data GenCommentsType = Signature | Record
54
56
55
57
toTitle :: GenCommentsType -> Text
56
58
toTitle Signature = " Generate signature comments"
57
- toTitle Record = " Generate fields comments"
59
+ toTitle Record = " Generate haddock comments"
58
60
59
61
caTitle :: (Command |? CodeAction ) -> Maybe Text
60
62
caTitle (InR CodeAction {_title}) = Just _title
Original file line number Diff line number Diff line change
1
+ module Record2 where
2
+
3
+ -- | A record
4
+ data Record = -- |
5
+ A { -- |
6
+ a :: Int , -- |
7
+ b :: String }
8
+ | -- |
9
+ B { -- |
10
+ bb :: Double }
Original file line number Diff line number Diff line change
1
+ module Record2 where
2
+
3
+ -- | A record
4
+ data Record = A { a :: Int , b :: String } | B { bb :: Double }
Original file line number Diff line number Diff line change
1
+ module Record2 where
2
+
3
+ -- | A record
4
+ data Record = -- |
5
+ RecordA
6
+ { -- |
7
+ a :: Int
8
+ , -- |
9
+ b :: String
10
+ }
Original file line number Diff line number Diff line change
1
+ module Record2 where
2
+
3
+ -- | A record
4
+ data Record = RecordA
5
+ { a :: Int
6
+ , b :: String
7
+ }
You can’t perform that action at this time.
0 commit comments