@@ -13,6 +13,7 @@ import Share.Postgres.IDs (BranchHashId)
1313import Share.Postgres.NameLookups.Types (NameLookupReceipt , NamedRef (.. ), ReversedName )
1414import Share.Postgres.Refs.Types (PGReference , PGReferent )
1515import Share.Prelude
16+ import U.Codebase.Referent qualified as V2
1617import Unison.Name (Name )
1718import Unison.Util.Relation (Relation )
1819import Unison.Util.Relation qualified as Rel
@@ -106,6 +107,21 @@ getRelevantTermsForDiff !_nameLookupReceipt oldBranchHashId newBranchHashId = do
106107 SELECT new.reversed_name, new.referent_builtin, new.referent_component_hash_id, new.referent_component_index, new.referent_constructor_index, true
107108 FROM relevant_terms_in_new new
108109 |]
110+ -- NOTE: For now we filter out all diffs on constructors.
111+ -- This is because:
112+ -- 1. We don't have a good way to construct a reasonable looking diff if a constructor
113+ -- is updated into a term
114+ -- 2. It's silly to render a change in a type in both the type itself AND all of its
115+ -- constructors
116+ --
117+ -- The downside is that this means if a constructor is only _renamed_ but not otherwise
118+ -- changed, it won't show up in the diff at all :'( , but we plan to fix this with the new
119+ -- synhash based diffing system.
120+ <&> filter
121+ ( \ (NamedRef {ref} PG. :. _) -> case ref of
122+ V2. Ref {} -> True
123+ V2. Con {} -> False
124+ )
109125 <&> ( fmap \ (NamedRef {reversedSegments, ref} PG. :. PG. Only inNew) ->
110126 if inNew
111127 then Right (from @ ReversedName @ Name reversedSegments, ref)
0 commit comments