Commit graph

301 commits

Author SHA1 Message Date
Sean Hagstrom
e2e77a2324
formatter: add newlines between parens delimiters for multiline expressions 2022-05-24 11:19:30 +01:00
Sean Hagstrom
c53f6cf2fe
formatter: remove spaces at the beginning and end of single-line square bracket expressions 2022-05-22 14:06:34 +01:00
Sean Hagstrom
4981f081a7
formatter: refactor fmt_collection to receive enum for braces type 2022-05-22 11:44:10 +01:00
Sean Hagstrom
c7e6547c9a
formatter: support outdenting multi-line annotations for record types and tag unions 2022-05-21 20:18:32 +01:00
Ayaz
e5eb9c9f1c
Merge pull request #3052 from rtfeldman/build-encode
Encode/JSON in standard library typechecks
2022-05-19 21:16:59 -04:00
ayazhafiz
7a732c7d4a
Fix ability formatting 2022-05-19 18:30:36 -04:00
Ayaz Hafiz
e78b345ee0
Format has-derived clauses 2022-05-19 18:29:31 -04:00
ayazhafiz
b1d46d87ae
Fix ability formatting 2022-05-19 18:21:44 -04:00
ayazhafiz
355b573695
Format Json 2022-05-19 18:21:44 -04:00
Sean Hagstrom
08777434b6
formatter: support removing blank lines between all when branches in when expressions 2022-05-19 09:26:04 +01:00
Sean Hagstrom
802422e6f4
formatter: support removing blank lines between when branches if all branches are single line 2022-05-19 09:07:31 +01:00
Sean Hagstrom
7def844302
formatter: support allowing single line value expressions in when expressions 2022-05-19 09:07:30 +01:00
Sean Hagstrom
1f98691929
formatter: refactor code for formatting when expressions 2022-05-19 09:07:30 +01:00
Ayaz Hafiz
50769b81e6
Format other stdlib modules 2022-05-18 15:40:02 -04:00
Ayaz Hafiz
f2eb87a524
Format Dict 2022-05-18 15:32:36 -04:00
Ayaz Hafiz
521f1e2c6c
Format bool builtins 2022-05-18 14:31:44 -04:00
Ayaz Hafiz
33945a7d5c
Add env var for workspace root and scaffold builtins fmt test 2022-05-18 14:30:03 -04:00
Richard Feldman
2c09907116
Merge pull request #3078 from rtfeldman/formatter-multiline-fn-type-annotated-bodies
Fix multi-line function type annotations for annotated bodies
2022-05-17 23:25:21 -04:00
Richard Feldman
56896f7624
Merge pull request #3080 from rtfeldman/formatter-cli-panic-ast-diff
Fix AST normalization of TypeHeaders in Aliases for CLI formatter
2022-05-17 23:23:10 -04:00
Sean Hagstrom
be798974c2
fix(formatter): ensure we normalize TypeHeaders in Aliases when comparing ASTs when running cli formatting 2022-05-16 22:25:33 +01:00
Sean Hagstrom
98a174c984
fix(formatter): ensure multi-line function type annotations for annotated bodies are indented properly 2022-05-16 22:25:01 +01:00
Sean Hagstrom
750ca52deb
improvement(formatter): format empty record patterns without spaces 2022-05-16 22:23:58 +01:00
Anton-4
0f59f3097a
cargo fix --edition 2022-05-16 17:04:17 +02:00
Sean Hagstrom
b91d6aa5a9 fix(formatter): ensure arguments and return value in multi-line function annotation are on separate lines
Added tests based on the examples in: Issue #2587
Removed outdated comment and debug_assert statement
Updated the tests for multi-line higher order function annotations
2022-05-14 14:23:56 +01:00
Richard Feldman
fd40fed937
Fix a bunch of errors from clippy --tests 2022-05-10 15:21:48 -04:00
Richard Feldman
36255b056b
Test expected == actual after verifying idempotence 2022-05-06 14:45:59 -04:00
Richard Feldman
a8991dc268
Trim inputs and expected in fmt tests 2022-05-06 14:37:23 -04:00
Richard Feldman
eb1d572b24
Test that modules reformat stably too 2022-05-06 14:37:23 -04:00
Richard Feldman
ad51624eb2
Write a better test for tui example 2022-05-06 14:37:23 -04:00
Richard Feldman
eb8e7d6a97
Verify stable formatting in fmt tests 2022-05-06 14:37:22 -04:00
Richard Feldman
c0f18f1c52
Move RemoveSpaces into fmt, for use in tests 2022-05-06 14:37:22 -04:00
Richard Feldman
7be5948476
Add formatter test 2022-05-06 14:37:22 -04:00
Richard Feldman
2c3731f7de
Drop an unnecessary lifetime annotation 2022-05-06 12:06:28 -04:00
Sean Hagstrom
4707528caa feature(formatter): allow single blank line around comments in lists, records, type annotations 2022-05-01 18:28:49 +01:00
Sean Hagstrom
e6621e5167 remove outdated test for inline comment formatting
I tested if the formatter was still inconsistent by locally changing the helloWorld example to have:
```
main =
    greeting = "Hello, World!\n" # This variable is for greeting

    greeting
```
And running the formatter multiple times with `cargo run -- formatter`.
At the moment the results are consistent and the inline comments remains inlined.
2022-04-30 14:37:53 +01:00
Sean Hagstrom
e36aad6310 fix(formatter): format and allow inline comments for defs 2022-04-30 14:34:33 +01:00
Richard Feldman
85e7969c2d
Replace references to "global tag" with "tag" 2022-04-25 17:04:34 -04:00
Ayaz Hafiz
1ed9cf551a
Remove private tags from Ast 2022-04-25 11:20:37 -04:00
Sean Hagstrom
1227f9f404 fix(formatter): fix potential panic when subtracting from usize 2022-04-24 19:58:12 +01:00
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
cd8ab753e3
remove %% operator 2022-04-18 19:15:14 -06:00
Kevin Gillette
9ed4ca9739
remove Num.mod and Num.modUnchecked 2022-04-18 13:54:40 -06:00
Ayaz Hafiz
a3ac68a41f
Split up Defs into TypeDef and ValueDef
Just a refactoring PR. This is useful because during canonicalization
we always process type defs first, then value defs. With abilities this
distinction continues to grow; in that case, we have patterns associated
with types that we want to process before patterns from values.
2022-04-06 22:18:57 -04:00
Ayaz Hafiz
eee19bba2b
s/demands/members 2022-04-06 11:34:55 -04:00
ayazhafiz
d7abc3897b Parse abilities 2022-03-12 21:29:06 -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
dd85caa85a
removed redundant derefs 2022-03-08 13:56:43 +01:00
Anton-4
0637344361
cleanup 2022-03-07 18:16:17 +01:00