Commit Graph

87 Commits

Author SHA1 Message Date
Greg Pfeil
0031542faf
Add a space before code block info strings
This is for consistency with the `cmark` style. Now the blocks we still
pretty-print ourselves will match the bulk of them that `cmark`
produces.
2024-07-10 13:56:07 -06:00
Greg Pfeil
1dc181b99a
Update the transcripts with cmark
`cmark`’s pretty-printer matches our output pretty well, with a few differences:
- it puts a space between the fence and the info string for in code blocks;
- it prefers `-` over `*` for bulleted lists (as do I) and it indents them;
- it `\`-escapes certain chars very conservatively;
- it prefers indented/unfenced code blocks if there is no info string; and
- it prefers `*` over `_` (unlike any sane person).

This also shows how the change fixes a number of issues:
- fix2158-1.output.md also illustrates how this change fixes #1809;
- alias-many.output.md and input-parse-errors.output.md show how fenced
  code blocks without an info string would use the beginning of the
  content as the info string;
- transcripts-round-trip/main.output.md shows how output blocks for
  generated `unison` stanzas (which could contain nested fenced blocks)
  might not have long-enough fences; and
- error-messages.output.md and generic-parse-errors.output.md show how
  Unison errors were reported on the wrong line number (and thus the
  printed error lines were also incorrect).
2024-07-10 13:37:51 -06:00
Paul Chiusano
97838c4883 Merge remote-tracking branch 'origin/trunk' into topic/force-syntax
# Conflicts:
#	unison-src/transcripts-round-trip/main.output.md
#	unison-src/transcripts-round-trip/reparses-with-same-hash.u
2024-06-24 18:53:04 -05:00
Arya Irani
2d33fd10a0 merge trunk 2024-06-23 11:59:32 -04:00
Eduard Nicodei
9c610510c1 update main.output.md 2024-06-22 18:09:28 +01:00
Eduard Nicodei
85ab99f605 add test in reparses-with-same-hash
# Conflicts:
#	unison-src/transcripts-round-trip/reparses-with-same-hash.u
2024-06-22 18:09:28 +01:00
Eduard Nicodei
7108787a5a add more tests 2024-06-22 14:03:08 +01:00
Eduard Nicodei
25ce29301b add tests 2024-06-22 13:51:18 +01:00
Paul Chiusano
58818242a3 reduce scope of PR to just !foo vs foo(), refresh transcripts 2024-06-21 09:41:32 -05:00
Paul Chiusano
72a05780a0 add round trip test case 2024-06-20 17:18:04 -05:00
Paul Chiusano
109a4de506 Prefer do in pretty-printer 2024-03-16 09:10:48 -05:00
Chris Penner
cb974e7ae1 Newlines within {{ }} for multi-line docs 2024-01-31 11:27:49 -08:00
Arya Irani
da20682818 update transcript outputs again 2024-01-09 13:33:28 -10:00
Arya Irani
9833ef08b3 don't have to use /private/tmp/rewrites-tmp.u now 2024-01-09 13:27:05 -10:00
Chris Penner
f930583994 Rerun round-trip transcripts 2024-01-04 15:24:13 -08:00
andrii
8b857b152c Adding a message for when ucm started reloading changes 2023-12-22 12:55:24 +01:00
Chris Penner
0327727002 Update transcripts 2023-12-06 12:48:20 -08:00
Paul Chiusano
42976e83c8 fix #4384 and add regression tests 2023-12-01 10:17:07 -06:00
Paul Chiusano
4a434580d9 add another regression test 2023-11-04 21:31:49 -05:00
Paul Chiusano
70855968a3 fix parser issue reported by @stew 2023-11-04 21:27:40 -05:00
Paul Chiusano
5648a1c99d tweaks to fix weirdness where foo x () y would render as (foo x ()) y 2023-11-04 12:58:13 -05:00
Paul Chiusano
20bcebf093 Move ! treatment to specialCases 2023-11-04 12:53:21 -05:00
Paul Chiusano
a428b41f52 fix #4340 2023-11-04 11:17:39 -05:00
Paul Chiusano
6559d2fafd failing regression test for #4340 2023-11-04 11:08:01 -05:00
Paul Chiusano
d5e29e61b8 fix issue with use clause insertion 2023-11-04 10:09:49 -05:00
Paul Chiusano
6d704104a5 fix #4352 and add regression test 2023-11-04 09:27:25 -05:00
Paul Chiusano
d494cf71cb fix regression reported by @runarorama 2023-09-07 17:13:51 -05:00
Paul Chiusano
25e67ed5e7 fix #4272 2023-08-21 10:00:37 -05:00
Paul Chiusano
95dd8747ff Merge remote-tracking branch 'origin/trunk' into fix/sig-cleanup
# Conflicts:
#	unison-src/transcripts-round-trip/main.output.md
#	unison-src/transcripts-round-trip/reparses.u
2023-08-17 16:59:32 -05:00
Paul Chiusano
13f3aad25f Everything reparses with an identical hash now 2023-08-16 22:17:27 -05:00
Paul Chiusano
c42fd86edc wip 2023-08-16 16:21:58 -05:00
Kyle Goetz
c287cf4108 fixes #4239, pretty printing for single arg infix op terms no longer displays "error" 2023-08-12 00:00:41 -05:00
Paul Chiusano
ca71d0e7db use different path for scratch file for round trip test 2023-07-24 14:07:01 -04:00
Paul Chiusano
126ed3c4a7 revamp round trip tests 2023-07-24 09:55:58 -04:00
Paul Chiusano
6b7360959b fix #3239 and add regression test 2023-07-21 01:45:51 -04:00
Paul Chiusano
33ce2fdbc9 regression test (currently failing) for 3239 2023-07-21 01:25:40 -04:00
Paul Chiusano
fda2ebea69 Fix #3973 and add regression test 2023-07-21 00:55:12 -04:00
Paul Chiusano
b716984714 more soft hanging after 'with' for @SystemFw 2023-07-20 23:20:29 -04:00
Paul Chiusano
66dc3b0c3d fix issue reported by @stew where top level do blocks would infer syntactically invalid type 2023-07-20 22:56:13 -04:00
Paul Chiusano
04a5bd2988 lists now put trailing ] on newline when broken onto multiple lines
also now referring to list type in delimeters
2023-07-20 17:59:00 -04:00
Paul Chiusano
6ca9f877b0 when breaking a tuple onto multiple lines, put closing paren on its own line 2023-07-20 17:35:56 -04:00
Paul Chiusano
0a4448df36 fix issue with tuple printing 2023-07-20 17:32:29 -04:00
Paul Chiusano
48822e5e8e allow use clause insertion at top level bindings in certain cases 2023-07-20 17:14:08 -04:00
Paul Chiusano
f4c49a40ef better soft hang treatment for last arg of function application
breaks the soft hung element before the list of args
2023-07-20 09:55:33 -04:00
Paul Chiusano
087157ad24 fix issue reported by @stew 2023-07-19 21:08:38 -04:00
Paul Chiusano
67cdc56ec2 more futzing with soft hang logic 2023-07-19 18:16:50 -04:00
Paul Chiusano
665f5d9df1 soft hangs for bindings that are a single function application that ends in a soft hang 2023-07-19 17:37:45 -04:00
Paul Chiusano
9064ddade3 fix quadratic performance issue - don't repeatedly call printAnnotate 2023-07-19 17:15:27 -04:00
Paul Chiusano
167cb252a7 fix #3883 2023-07-19 15:56:05 -04:00
Paul Chiusano
5be04c398e fix #3936 use soft hang of do more aggressively 2023-07-19 15:50:17 -04:00