File tree 3 files changed +10
-0
lines changed
plugins/hls-hlint-plugin/test
3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -139,6 +139,9 @@ suggestionsTests =
139
139
, testCase " apply-refact preserve regular comments" $ runHlintSession " " $ do
140
140
testRefactor " Comments.hs" " Redundant bracket" expectedComments
141
141
142
+ , testCase " [#2290] apply all hints works with a trailing comment" $ runHlintSession " " $ do
143
+ testRefactor " TwoHintsAndComment.hs" " Apply all hints" expectedComments2
144
+
142
145
, testCase " applyAll is shown only when there is at least one diagnostic in range" $ runHlintSession " " $ do
143
146
doc <- openDoc " TwoHints.hs" " haskell"
144
147
_ <- waitForDiagnosticsFromSource doc " hlint"
@@ -212,6 +215,9 @@ suggestionsTests =
212
215
, " f = {- inline comment -}{- inline comment inside refactored code -} 1 -- ending comment" , " "
213
216
, " -- final comment"
214
217
]
218
+ expectedComments2 = [ " module TwoHintsAndComment where"
219
+ , " biggest items = foldr1 max -- the line above will show two hlint hints, \" eta reduce\" and \" use maximum\" "
220
+ ]
215
221
expectedTypeApp = [ " module TypeApplication where" , " "
216
222
, " a = id @Int 1"
217
223
]
Original file line number Diff line number Diff line change
1
+ module TwoHintsAndComments where
2
+
3
+ biggest items = foldr1 max items -- the line above will show two hlint hints, "eta reduce" and "use maximum"
Original file line number Diff line number Diff line change @@ -13,3 +13,4 @@ cradle:
13
13
- " TwoHints"
14
14
- " PatternKeyword"
15
15
- " StrictData"
16
+ - " TwoHintsAndComment"
You can’t perform that action at this time.
0 commit comments