Commit Graph

89 Commits

Author SHA1 Message Date
Ayaz Hafiz
9bb523ce97
Format list patterns 2022-10-26 17:08:10 -05:00
Ayaz Hafiz
4d35ab9957
Parse list patterns 2022-10-26 17:03:22 -05:00
Ayaz Hafiz
1053c11907
Basic formatting of multi-abilities 2022-10-24 14:00:46 -05:00
Ayaz Hafiz
548a235c25
Support parsing multiple abilities in a clause 2022-10-24 13:56:06 -05:00
Joshua Warner
e39a385f5f
Allow parsing when cases with python-like indentation 2022-10-18 19:13:20 -07:00
Ayaz Hafiz
df3b7cb1b4
Preserve comments before header
Closes #4212
2022-10-05 08:34:30 -05:00
Ayaz Hafiz
f6c21cc933
Correctly format abilities with comments 2022-10-04 10:03:51 -05:00
Ayaz Hafiz
bbb2083dd6
Correctly format nested pipeline operators
Closes #4151
2022-10-03 14:18:17 -05:00
Ayaz Hafiz
3883867b5c
Properly format characters with escape sequences
Ran into this just now
2022-10-02 17:10:34 -05:00
Ayaz Hafiz
6a83babaf3
Don't write extra newline if it's already there 2022-09-14 11:26:52 -05:00
Ayaz Hafiz
31b894d027
Remove region when normalizing expects 2022-09-14 11:26:48 -05:00
dependabot[bot]
0079048944
Bump bumpalo from 3.10.0 to 3.11.0
Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.10.0 to 3.11.0.
- [Release notes](https://github.com/fitzgen/bumpalo/releases)
- [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md)
- [Commits](https://github.com/fitzgen/bumpalo/compare/3.10.0...3.11.0)

---
updated-dependencies:
- dependency-name: bumpalo
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 21:08:56 +00:00
dependabot[bot]
d1c406812f
Bump pretty_assertions from 1.2.1 to 1.3.0
Bumps [pretty_assertions](https://github.com/rust-pretty-assertions/rust-pretty-assertions) from 1.2.1 to 1.3.0.
- [Release notes](https://github.com/rust-pretty-assertions/rust-pretty-assertions/releases)
- [Changelog](https://github.com/rust-pretty-assertions/rust-pretty-assertions/blob/main/CHANGELOG.md)
- [Commits](https://github.com/rust-pretty-assertions/rust-pretty-assertions/compare/v1.2.1...v1.3.0)

---
updated-dependencies:
- dependency-name: pretty_assertions
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-12 05:28:00 +00:00
Richard Feldman
be0c098b76
Revert "Always put the | in a has clause on a new line"
This reverts commit fd2ef1a3ce.
2022-09-11 20:25:15 -04:00
Richard Feldman
5d7213aa7d
Removed an || condition that was always false 2022-09-11 20:19:22 -04:00
Richard Feldman
fd2ef1a3ce
Always put the | in a has clause on a new line 2022-09-11 20:19:11 -04:00
Richard Feldman
8e6abc8079
Clean up some formatter logic 2022-09-11 20:18:40 -04:00
Ayaz Hafiz
fc6561ecb6
Format string literals in patterns 2022-09-07 17:30:52 -05:00
raleng
85eda83398
Enable and add multi-line string formatting tests 2022-08-26 12:19:14 +02:00
raleng
1c8bc7d969
Fix formatting block string containing quotes
Single-line block strings are parsed as PlainLines. When the string
contains quotes, this leads to invalid formatted strings. This commit
special cases strings containing quotes the same as strings containing
newlines and formats them to multiple lines using triple-quotes.
2022-08-26 11:36:54 +02:00
raleng
4991adb05b
Fix multiline string formatting
This change adds the proper indentation when formatting multiline
strings to not end up with invalid code. This also make sure that
multiline strings are always formatted using multiple lines, regardless
of the string literal itself contains a newline.
2022-08-26 11:13:37 +02:00
raleng
1b2952bc70
Fix invalid multiline string output in REPL
If a PlainLine string contains a newline character, the REPL will print
the string using a triple-quoted block string.
2022-08-23 11:26:48 +02:00
dependabot[bot]
4c6ad52c47
Bump indoc from 1.0.6 to 1.0.7
Bumps [indoc](https://github.com/dtolnay/indoc) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/dtolnay/indoc/releases)
- [Commits](https://github.com/dtolnay/indoc/compare/1.0.6...1.0.7)

---
updated-dependencies:
- dependency-name: indoc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-15 13:18:18 +00:00
Richard Feldman
97e2900bf5
s/rtfeldman/roc-lang/g in links to GitHub repos 2022-08-12 15:24:09 -04:00
Folkert
bcbc8b4d50
basic canonicalization 2022-08-09 13:59:24 +02:00
Folkert de Vries
289319c900
Merge pull request #3704 from rtfeldman/fix-expect-fmt
Fix `expect` formatting
2022-08-05 16:12:53 +02:00
Richard Feldman
a3e441c086
Fix top-level expect formatting bugs 2022-08-04 23:14:19 -04:00
Richard Feldman
862b58b8f9
Fix expect formatting in expressions 2022-08-04 23:14:19 -04:00
Richard Feldman
0d0cebc40d
Reproduce expect formatting bugs 2022-08-04 23:14:16 -04:00
Anton-4
6a15a7b41b
changed Cargo versions from 0.1.0 to 0.0.1 2022-08-03 11:41:19 +02:00
Folkert
7597d11b59
parse the region of the preceding comment for an expect 2022-07-21 10:42:57 -04:00
Richard Feldman
f575807834
Merge remote-tracking branch 'origin/trunk' into outdent-infix 2022-07-16 16:08:36 -04:00
Ayaz Hafiz
be9944a7e1
Improve indent of has-abilities clauses 2022-07-15 11:59:03 -04:00
Ayaz Hafiz
3c65fbcf35
Format has clauses with impls 2022-07-15 11:45:53 -04:00
Ayaz Hafiz
85cbab0193
Add fmt test for empty has abilities block 2022-07-15 11:17:21 -04:00
Ayaz Hafiz
3ada644544
Format impls blocks 2022-07-15 11:14:49 -04:00
Ayaz Hafiz
d4d073d8c6
Rename Derived to HasAbility 2022-07-14 10:38:37 -04:00
Richard Feldman
897c6b17df
cargo fmt 2022-07-14 10:22:40 -04:00
Richard Feldman
87bb1d7b3d
Update formatting tests 2022-07-13 23:19:28 -04:00
Richard Feldman
47dd3743e7
Revert "Don't keep comments right after the ->"
This reverts commit 326337ae00624e7f326ce92aa473a48283bcbf98.
2022-07-13 23:16:08 -04:00
Richard Feldman
18be76ea43
Don't keep comments right after the ->
(at least not when the branch is a multiline expr!)
2022-07-13 23:16:08 -04:00
Richard Feldman
d3f5117d76
Revert "Simplify some branch formatting logic"
This reverts commit 597055c1e580363f8645d3f9cc74134bd1e07bbe.
2022-07-13 23:16:08 -04:00
Richard Feldman
b51c8b0ba4
Simplify some branch formatting logic 2022-07-13 23:16:08 -04:00
Richard Feldman
fa877e4184
Revert "Special-case records, lists, functions in def fmt"
This reverts commit c0b4ceea9b1d817c923eb82fa3ff7a36db90199f.
2022-07-13 22:32:42 -04:00
Richard Feldman
2be68189b4
Special-case records, lists, functions in def fmt 2022-07-13 22:32:42 -04:00
Richard Feldman
8178f22ce4
Always put a newline after a binop def body 2022-07-13 22:32:41 -04:00
Richard Feldman
9e19baef59
Don't indent next expr after multiline binop 2022-07-13 22:05:04 -04:00
Richard Feldman
28e0a9e382
Don't indent multiple patterns 2022-07-13 21:50:30 -04:00
Richard Feldman
f066ee12dc
Don't indent multiline infix operators 2022-07-13 21:40:28 -04:00
Richard Feldman
434bcd08fd
s/ends_in_newline/ends_with_newline/g 2022-07-11 13:15:22 -04:00