From 80143eb9a289710e72f520065b7d88b766da78d1 Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Wed, 24 Jul 2024 12:58:15 -0600 Subject: [PATCH 1/2] Add transcripts for some already-fixed issues This fixes #1327 (which was actually fixed by #5056 or #5061) and #3977 was already closed, but without the transcript to avoid regression. --- unison-src/transcripts/fix1327.md | 11 ++++++ unison-src/transcripts/fix1327.output.md | 46 ++++++++++++++++++++++++ unison-src/transcripts/fix3977.md | 15 ++++++++ unison-src/transcripts/fix3977.output.md | 42 ++++++++++++++++++++++ 4 files changed, 114 insertions(+) create mode 100644 unison-src/transcripts/fix1327.md create mode 100644 unison-src/transcripts/fix1327.output.md create mode 100644 unison-src/transcripts/fix3977.md create mode 100644 unison-src/transcripts/fix3977.output.md diff --git a/unison-src/transcripts/fix1327.md b/unison-src/transcripts/fix1327.md new file mode 100644 index 0000000000..764d0f3ac5 --- /dev/null +++ b/unison-src/transcripts/fix1327.md @@ -0,0 +1,11 @@ +```unison +foo = 4 + +bar = 5 +``` + +```ucm +scratch/main> add +scratch/main> ls +scratch/main> alias.many 1-2 .ns1_nohistory +``` diff --git a/unison-src/transcripts/fix1327.output.md b/unison-src/transcripts/fix1327.output.md new file mode 100644 index 0000000000..fa542e6ed2 --- /dev/null +++ b/unison-src/transcripts/fix1327.output.md @@ -0,0 +1,46 @@ +``` 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 + +``` +``` 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. + +``` diff --git a/unison-src/transcripts/fix3977.md b/unison-src/transcripts/fix3977.md new file mode 100644 index 0000000000..8ad82cbce9 --- /dev/null +++ b/unison-src/transcripts/fix3977.md @@ -0,0 +1,15 @@ +```ucm:hide +scratch/main> builtins.merge +``` + +```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 +``` diff --git a/unison-src/transcripts/fix3977.output.md b/unison-src/transcripts/fix3977.output.md new file mode 100644 index 0000000000..79a68eedc4 --- /dev/null +++ b/unison-src/transcripts/fix3977.output.md @@ -0,0 +1,42 @@ +``` 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") + ()) +``` + From 4803d446f1e361cf33c85daf698c6d58e31c796d Mon Sep 17 00:00:00 2001 From: Greg Pfeil Date: Thu, 1 Aug 2024 10:51:32 -0600 Subject: [PATCH 2/2] Add some description to the new transcripts --- unison-src/transcripts/fix1327.md | 4 ++++ unison-src/transcripts/fix1327.output.md | 4 ++++ unison-src/transcripts/fix3977.md | 2 ++ unison-src/transcripts/fix3977.output.md | 2 ++ 4 files changed, 12 insertions(+) diff --git a/unison-src/transcripts/fix1327.md b/unison-src/transcripts/fix1327.md index 764d0f3ac5..45c1e11e92 100644 --- a/unison-src/transcripts/fix1327.md +++ b/unison-src/transcripts/fix1327.md @@ -4,6 +4,10 @@ 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 diff --git a/unison-src/transcripts/fix1327.output.md b/unison-src/transcripts/fix1327.output.md index fa542e6ed2..9e0234725a 100644 --- a/unison-src/transcripts/fix1327.output.md +++ b/unison-src/transcripts/fix1327.output.md @@ -18,6 +18,10 @@ bar = 5 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 diff --git a/unison-src/transcripts/fix3977.md b/unison-src/transcripts/fix3977.md index 8ad82cbce9..fc1fc1c718 100644 --- a/unison-src/transcripts/fix3977.md +++ b/unison-src/transcripts/fix3977.md @@ -2,6 +2,8 @@ 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) diff --git a/unison-src/transcripts/fix3977.output.md b/unison-src/transcripts/fix3977.output.md index 79a68eedc4..d4451d8c94 100644 --- a/unison-src/transcripts/fix3977.output.md +++ b/unison-src/transcripts/fix3977.output.md @@ -1,3 +1,5 @@ +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)