Skip to content

Commit

Permalink
Merge pull request #5252 from sellout/test-1327
Browse files Browse the repository at this point in the history
  • Loading branch information
aryairani authored Aug 3, 2024
2 parents c049c65 + 4803d44 commit f63cfbe
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 0 deletions.
15 changes: 15 additions & 0 deletions unison-src/transcripts/fix1327.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
```unison
foo = 4
bar = 5
```

`alias.many` should be able to consume the numbered args produced by `ls`. Previously, `ls` would produce absolute paths, but `alias.many` required relative ones.

Now `ls` returns a pair of the absolute search directory and the result relative to that search directory, so it can be used in both absolute and relative contexts.

```ucm
scratch/main> add
scratch/main> ls
scratch/main> alias.many 1-2 .ns1_nohistory
```
50 changes: 50 additions & 0 deletions unison-src/transcripts/fix1327.output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
``` unison
foo = 4
bar = 5
```

``` ucm
Loading changes detected in scratch.u.
I found and typechecked these definitions in scratch.u. If you
do an `add` or `update`, here's how your codebase would
change:
⍟ These new definitions are ok to `add`:
bar : ##Nat
foo : ##Nat
```
`alias.many` should be able to consume the numbered args produced by `ls`. Previously, `ls` would produce absolute paths, but `alias.many` required relative ones.

Now `ls` returns a pair of the absolute search directory and the result relative to that search directory, so it can be used in both absolute and relative contexts.

``` ucm
scratch/main> add
⍟ I've added these definitions:
bar : ##Nat
foo : ##Nat
scratch/main> ls
1. bar (##Nat)
2. foo (##Nat)
scratch/main> alias.many 1-2 .ns1_nohistory
Here's what changed in .ns1_nohistory :
Added definitions:
1. bar : ##Nat
2. foo : ##Nat
Tip: You can use `undo` or use a hash from `reflog` to undo
this change.
```
17 changes: 17 additions & 0 deletions unison-src/transcripts/fix3977.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```ucm:hide
scratch/main> builtins.merge
```

Pretty-printing previously didn’t compensate for extra characters on a line that was about to be wrapped, resulting in a line-break without sufficient indentation. Now pretty-printing indents based on the starting column of the wrapped expression, not simply “prevIndent + 2”.

```unison:hide
failure msg context = Failure (typeLink Unit) msg (Any context)
foo = Left (failure ("a loooooooooooooooooooooooooooooooooong" ++ "message with concatenation") ())
```

```ucm
scratch/main> add
scratch/main> edit foo
scratch/main> load scratch.u
```
44 changes: 44 additions & 0 deletions unison-src/transcripts/fix3977.output.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Pretty-printing previously didn’t compensate for extra characters on a line that was about to be wrapped, resulting in a line-break without sufficient indentation. Now pretty-printing indents based on the starting column of the wrapped expression, not simply “prevIndent + 2”.

``` unison
failure msg context = Failure (typeLink Unit) msg (Any context)
foo = Left (failure ("a loooooooooooooooooooooooooooooooooong" ++ "message with concatenation") ())
```

``` ucm
scratch/main> add
⍟ I've added these definitions:
failure : Text -> context -> Failure
foo : Either Failure b
scratch/main> edit foo
☝️
I added 1 definitions to the top of scratch.u
You can edit them there, then run `update` to replace the
definitions currently in this namespace.
scratch/main> load scratch.u
Loading changes detected in scratch.u.
I found and typechecked the definitions in scratch.u. This
file has been previously added to the codebase.
```
``` unison:added-by-ucm scratch.u
foo : Either Failure b
foo =
use Text ++
Left
(failure
("a loooooooooooooooooooooooooooooooooong"
++ "message with concatenation")
())
```

0 comments on commit f63cfbe

Please sign in to comment.