Skip to content

Conversation

@bbarker
Copy link
Contributor

@bbarker bbarker commented Jan 9, 2026

Overview

The diff.update command now shows the full structure of new types and abilities, not just their names.

Before:

New definitions:
  + ability Counter
  + structural type Person

After:

New definitions:
  + ability Counter where
  +   increment : {Counter} Nat
  +   getCount : {Counter} Nat
  + structural type Person = { name : Text, age : Nat }

This matches the behavior for updated types, which already showed their full structure with inline diffs.

Implementation approach and notes

Changed renderNewTypes in OutputMessages.hs to use DeclPrinter.prettyDecl (full declaration rendering) instead of DeclPrinter.prettyDeclOrBuiltinHeader (header only). This required threading TypeReferenceId through from DiffUpdate.hs and updating the ShowUpdateDiff type in Output.hs.

Test coverage

  • Added test case to unison-src/transcripts/idempotent/diff-update.md that covers new structural types and abilities

Loose ends

None.

Final checklist

  • PR title describes the change
  • Transcript demonstrates the changed behavior

]
ShowUpdateDiff ppedNew ppedOld newDefns updatedDefns dependents -> do
let ppe = PPED.suffixifiedPPE ppedNew
let colorAdd = P.green . ("+ " <>)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this definition is no longer used, was that intentional? Or maybe it got copied somewhere else?

It's hitting "warnings as errors" in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants