Commit graph

97 commits

Author SHA1 Message Date
Sean Hagstrom
477ed3c5e8 feat(formatter): allow single-line function call ending with multi-line lambda 2022-04-24 18:55:57 +01:00
Sean Hagstrom
b147890b08 feat(formatter): implement outdent formatting for multiline lists and records 2022-04-24 16:52:02 +01:00
Kevin Gillette
9ed4ca9739
remove Num.mod and Num.modUnchecked 2022-04-18 13:54:40 -06:00
Anton-4
56dc06a139
fixed the previous formatting change when inside longer pipeline 2022-03-09 14:07:52 +01:00
Anton-4
ba5d47d270
Merge branch 'trunk' of github.com:rtfeldman/roc into roc_fmt_fixes 2022-03-08 13:57:20 +01:00
Anton-4
21a30b1e83
fixed indentation for apply args 2022-03-07 16:23:15 +01:00
Anton-4
454933e2c6
fixed unnecessary double indentation 2022-03-07 16:02:11 +01:00
Folkert
836967b919
some other clippy things in tests 2022-03-06 19:07:38 +01:00
Pierre-Henri Trivier
1d3aa26193 Fixes #2586 2022-03-04 23:50:00 +01:00
Richard Feldman
881bae7267
Merge branch 'trunk' into fix-module-formatting 2022-02-04 23:03:52 -05:00
Folkert
885500712c remove old Effect module things 2022-02-03 23:55:02 +01:00
Folkert
a98635ed06 update other examples 2022-02-03 22:45:15 +01:00
Richard Feldman
200e237393
Add tests for multiline interface and hosted modules 2022-02-01 21:22:35 -05:00
Richard Feldman
099a0b5d41
Add formatting test for hosted modules 2022-01-30 20:40:51 -05:00
Folkert
f76a75b00e formatting fixes 2022-01-23 21:25:20 +01:00
Jan Van Bruggen
1e9d2d1239 Remove accidental trailing spaces 2022-01-18 22:25:46 -07:00
Joshua Warner
8b58d5cbc7 Switch to always encoding package names / paths as strings
This will simplify parsing and make it possible to have a uniform lexer for the language. Previously unquoted package names were allowed to include '-'s, which aren't valid identifiers.

In the future, we'll distinguish local paths from packages in the package-manager by looking for a ".roc" suffix, which should only be present in local paths.
2021-12-23 20:11:14 -08:00
Joshua Warner
825b93696c Improve error message & comment 2021-12-21 18:23:04 -08:00
Joshua Warner
6786acb939 Remove redundant space in aliases 2021-12-21 18:16:58 -08:00
Joshua Warner
4fed812389 add test_fmt_examples 2021-12-21 17:25:36 -08:00
Joshua Warner
61cdbd1531 Fix formatting of pipelined call exprs 2021-12-18 16:36:51 -08:00
Richard Feldman
cb4a74ac46
Merge pull request #2233 from rtfeldman/joshuawarner32/encapsulate-state
Encapsulate the `bytes` field of State in the parser
2021-12-17 14:42:06 -05:00
Joshua Warner
49818343dd extract state 2021-12-16 17:13:53 -08:00
Joshua Warner
c36b853286 Also assert module formatting is stable 2021-12-16 17:07:05 -08:00
Jan Van Bruggen
d03a51c75b Rename base package to pf everywhere, to match tutorial 2021-12-12 05:57:39 -07:00
Folkert
873ccc5d96 remove incorrect space 2021-12-06 09:45:11 +01:00
Folkert de Vries
8459339230
Merge branch 'trunk' into joshuawarner32/keep-trailing-comments 2021-12-06 09:19:13 +01:00
Joshua Warner
f3ed335a6c Remove unused import 2021-12-05 12:59:15 -08:00
Joshua Warner
e6eb9138f7 Improve TypedIdent spacing in formatting 2021-12-05 12:58:48 -08:00
Joshua Warner
f3dd9e411f Keep trailing comments at the end of a file 2021-12-05 12:19:58 -08:00
Joshua Warner
e3f2f8d9a4 keep indent state in fmt Buf 2021-12-04 18:26:32 -08:00
Joshua Warner
4bbe1d308a rename expect_format_helper and add comment 2021-12-03 19:32:44 -08:00
Joshua Warner
5d3d4467c1 Fix indentation & stability in with formatting 2021-12-03 13:33:25 -08:00
Joshua Warner
270cc49867 Also check formatting is stable in tests; ignore a test that's invalid / incorrect 2021-12-02 17:46:50 -08:00
Richard Feldman
23fda0819f
Merge pull request #2112 from rtfeldman/joshuawarner32/fix-defs-indenting
Fix fmt_spaces indenting in the context of 3 or more newlines
2021-12-01 21:58:58 -05:00
Richard Feldman
ed40a8fc1c
Merge pull request #2114 from rtfeldman/joshuawarner32/fix-det-indentation
Fix indentation within parens
2021-12-01 19:38:07 -05:00
Joshua Warner
6edb376fdd Modify test to make the problem clear 2021-12-01 16:14:27 -08:00
Joshua Warner
c6116ba3ca Fix fmt_spaces indenting in the context of 3 or more newlines 2021-12-01 16:14:27 -08:00
Folkert de Vries
d37ddeb162
Merge pull request #2113 from rtfeldman/joshuawarner32/fix-indentation-within-parens
Fix formatting of if as an left-hand-side of an operator
2021-12-01 13:38:22 +01:00
Joshua Warner
c0abf86f01 Fix indentation within parens 2021-11-30 17:55:50 -08:00
Joshua Warner
3228a23c98 Fix formatting of if as an left-hand-side of an operator 2021-11-30 17:53:26 -08:00
Joshua Warner
fdeafe4bab Make assert output more understandable 2021-11-30 17:48:24 -08:00
Folkert de Vries
d0da22edfa
Merge pull request #2089 from rtfeldman/joshuawarner32/fix-backpassing-formatting
Fix formatting of applies in backpassing
2021-11-27 15:46:10 +01:00
Joshua Warner
02b51bcd37 Fix formatting of applies in backpassing 2021-11-27 06:15:48 -08:00
Joshua Warner
e9d22699ed Make sure unary operators around function calls get parens 2021-11-26 20:01:45 -08:00
Joshua Warner
32a8222a37 Add test for formatting package type in TypeAnnotation::Apply 2021-11-26 13:58:17 -08:00
Joshua Warner
f25323e8a7 Implement platform header formatting 2021-11-25 08:19:31 -08:00
Joshua Warner
24f7692a73 Implement [more] app header formatting
Also, refactor out a utility method to format a Collection. This method can currently
replace some of the formatting done in module headers - but the goal is eventually
to be able to replace the code in fmt_list as well, such that there is 'one true way'
to format collections.
2021-11-23 12:19:43 -08:00
Chadtech
5e2decf89a Binops with parentheses keep their parentheses 2021-10-16 18:01:13 -04:00
Chadtech
56c36c51d7 Commented in many tests which apparently did not work in the past 2021-10-16 13:44:14 -04:00