File tree Expand file tree Collapse file tree 2 files changed +42
-3
lines changed Expand file tree Collapse file tree 2 files changed +42
-3
lines changed Original file line number Diff line number Diff line change @@ -762,9 +762,7 @@ indent the current line. This has to be fixed elsewhere."
762
762
(throw 'parse-end nil )))))
763
763
764
764
(defun purescript-indentation-layout (parser )
765
- (if (string= current-token " {" )
766
- (purescript-indentation-list parser " }" " ;" nil )
767
- (purescript-indentation-implicit-layout-list parser)))
765
+ (purescript-indentation-implicit-layout-list parser))
768
766
769
767
(defun purescript-indentation-expression-token (token )
770
768
(member token '(" if" " let" " do" " case" " \\ " " (" " [" " {" " ::"
Original file line number Diff line number Diff line change @@ -237,3 +237,44 @@ foo = do
237
237
identifier :: Array String <- function call
238
238
_ <- another call
239
239
pure unit" ))
240
+
241
+ (ert-deftest let-in-separate-lines ()
242
+ " Tests bug #12"
243
+ (purescript-test-indentation "
244
+ test1 a
245
+ = let { x } = a
246
+ in x"
247
+
248
+ "
249
+ test1 a
250
+ = let { x } = a
251
+ in x" ))
252
+
253
+ (ert-deftest case-of-separate-lines ()
254
+ " Tests bug #12"
255
+ (purescript-test-indentation "
256
+ test3 a
257
+ = case a of
258
+ { x: y }
259
+ -> y"
260
+
261
+ "
262
+ test3 a
263
+ = case a of
264
+ { x: y }
265
+ -> y" ))
266
+
267
+ (ert-deftest comma-first-list-after-case-of ()
268
+ " A comma-first list was getting misindented if goes after case-of"
269
+ :expected-result :failed
270
+ (purescript-test-indentation "
271
+ fun = case _ of
272
+ [ a
273
+ , b ]
274
+ "
275
+
276
+ "
277
+ fun = case _ of
278
+ [ a
279
+ , b ]
280
+ " ))
You can’t perform that action at this time.
0 commit comments