2024-01-17 02:33:16 +03:00
|
|
|
```ucm:hide
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> builtins.mergeio
|
2024-01-17 02:33:16 +03:00
|
|
|
```
|
|
|
|
|
2024-01-25 06:12:16 +03:00
|
|
|
```unison:hide
|
2024-01-17 02:33:16 +03:00
|
|
|
{{ # Doc
|
|
|
|
This is a *doc*!
|
|
|
|
|
|
|
|
term link {x}
|
|
|
|
|
2024-01-24 22:40:17 +03:00
|
|
|
type link {type Optional}
|
2024-01-17 02:33:16 +03:00
|
|
|
|
|
|
|
}}
|
|
|
|
x :
|
|
|
|
Nat
|
|
|
|
-> Nat
|
|
|
|
x y =
|
|
|
|
x = 1 + 1
|
|
|
|
x + y
|
|
|
|
-- Should keep comments after
|
|
|
|
|
2024-02-12 21:46:38 +03:00
|
|
|
-- symbolyDefinition
|
|
|
|
(<|>) : Nat -> Nat -> (Nat, Nat)
|
|
|
|
(<|>) a b = (a, b)
|
|
|
|
|
|
|
|
symbolyEndOfBlock =
|
2024-02-12 21:50:41 +03:00
|
|
|
x = 1
|
2024-02-12 21:46:38 +03:00
|
|
|
(+:)
|
|
|
|
|
|
|
|
|
2024-01-24 22:40:17 +03:00
|
|
|
-- Test for a previous regression that added extra brackets.
|
|
|
|
oneLiner = {{ one liner }}
|
|
|
|
-- After
|
|
|
|
|
|
|
|
-- Before
|
|
|
|
explicit.doc = {{
|
|
|
|
# Here's a top-level doc
|
|
|
|
|
|
|
|
With a paragraph
|
|
|
|
|
|
|
|
Or two
|
|
|
|
}}
|
|
|
|
-- After
|
|
|
|
|
2024-01-25 01:44:00 +03:00
|
|
|
{{ A doc before an ability }}
|
|
|
|
ability Thing where
|
|
|
|
more : Nat -> Text -> Nat
|
|
|
|
doThing : Nat -> Int
|
|
|
|
|
2024-02-05 21:45:03 +03:00
|
|
|
|
|
|
|
{{ Ability with single constructor }}
|
|
|
|
structural ability Ask a where
|
|
|
|
ask : {Ask a} a
|
|
|
|
|
|
|
|
-- Regression test for: https://github.com/unisonweb/unison/issues/4666
|
|
|
|
provide : a -> '{Ask a} r -> r
|
|
|
|
provide a action =
|
|
|
|
h = cases
|
|
|
|
{ask -> resume} -> handle resume a with h
|
|
|
|
{r} -> r
|
|
|
|
handle !action with h
|
|
|
|
|
2024-01-25 01:15:21 +03:00
|
|
|
{{
|
|
|
|
A Doc before a type
|
|
|
|
}}
|
2024-01-25 02:03:02 +03:00
|
|
|
structural type Optional a = More Text
|
2024-01-17 02:33:16 +03:00
|
|
|
| Some
|
|
|
|
| Other a
|
|
|
|
| None Nat
|
|
|
|
|
2024-01-25 21:23:46 +03:00
|
|
|
{{ A doc before a type with no type-vars }}
|
2024-01-25 06:12:16 +03:00
|
|
|
type Two = One Nat | Two Text
|
2024-02-05 21:17:32 +03:00
|
|
|
|
|
|
|
-- Regression for https://github.com/unisonweb/unison/issues/4669
|
|
|
|
|
|
|
|
multilineBold = {{
|
|
|
|
|
|
|
|
**This paragraph is really really really really really long and spans multiple lines
|
|
|
|
with a strike-through block**
|
|
|
|
|
|
|
|
_This paragraph is really really really really really long and spans multiple lines
|
|
|
|
with a strike-through block_
|
|
|
|
|
|
|
|
~This paragraph is really really really really really long and spans multiple lines
|
|
|
|
with a strike-through block~
|
|
|
|
|
|
|
|
}}
|
2024-01-17 02:33:16 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> debug.format
|
2024-01-17 02:33:16 +03:00
|
|
|
```
|
2024-01-25 01:15:21 +03:00
|
|
|
|
|
|
|
Formatter should leave things alone if the file doesn't typecheck.
|
|
|
|
|
|
|
|
```unison:error
|
|
|
|
brokenDoc = {{ hello }} + 1
|
|
|
|
```
|
|
|
|
|
|
|
|
```ucm
|
2024-06-12 01:22:09 +03:00
|
|
|
scratch/main> debug.format
|
2024-01-25 01:15:21 +03:00
|
|
|
```
|