From 711d3d2fdfe96015ad32eaef0de03133d7cf1e94 Mon Sep 17 00:00:00 2001 From: Mitchell Dalvi Rosen Date: Thu, 5 Jun 2025 14:09:09 -0400 Subject: [PATCH 1/2] add path key to "lib found at unexpected path" error --- src/Share/NamespaceDiffs.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Share/NamespaceDiffs.hs b/src/Share/NamespaceDiffs.hs index 79827671..af8a3f88 100644 --- a/src/Share/NamespaceDiffs.hs +++ b/src/Share/NamespaceDiffs.hs @@ -290,9 +290,10 @@ instance ToJSON NamespaceDiffResult where in case reason of EitherWay.Alice reason -> f "old" reason EitherWay.Bob reason -> f "new" reason - LibFoundAtUnexpectedPath _ -> + LibFoundAtUnexpectedPath path -> Aeson.object [ "tag" .= ("libFoundAtUnexpectedPath" :: Text) + , "path" .= path ] MissingEntityError _ -> Aeson.object From c05c3c073e0def8354f35f3f234c753f117afa89 Mon Sep 17 00:00:00 2001 From: mitchellwrosen Date: Fri, 6 Jun 2025 14:09:45 +0000 Subject: [PATCH 2/2] automatically run ormolu --- src/Share/NamespaceDiffs.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Share/NamespaceDiffs.hs b/src/Share/NamespaceDiffs.hs index af8a3f88..f7f2e91f 100644 --- a/src/Share/NamespaceDiffs.hs +++ b/src/Share/NamespaceDiffs.hs @@ -265,7 +265,8 @@ instance ToJSON NamespaceDiffResult where let f :: Text -> IncoherentDeclReason -> Aeson.Value f which reason = Aeson.object - ( "oldOrNewBranch" .= which + ( "oldOrNewBranch" + .= which : case reason of IncoherentDeclReason'ConstructorAlias typeName constructorName1 constructorName2 -> [ "tag" .= ("constructorAlias" :: Text), @@ -292,8 +293,8 @@ instance ToJSON NamespaceDiffResult where EitherWay.Bob reason -> f "new" reason LibFoundAtUnexpectedPath path -> Aeson.object - [ "tag" .= ("libFoundAtUnexpectedPath" :: Text) - , "path" .= path + [ "tag" .= ("libFoundAtUnexpectedPath" :: Text), + "path" .= path ] MissingEntityError _ -> Aeson.object @@ -409,8 +410,7 @@ instance ToJSON NamespaceDiffResult where type NamespaceAndLibdepsDiff referent reference renderedTerm renderedType termDiff typeDiff libdep = GNamespaceAndLibdepsDiff Path referent reference renderedTerm renderedType termDiff typeDiff libdep -data GNamespaceAndLibdepsDiff k referent reference renderedTerm renderedType termDiff typeDiff libdep - = NamespaceAndLibdepsDiff +data GNamespaceAndLibdepsDiff k referent reference renderedTerm renderedType termDiff typeDiff libdep = NamespaceAndLibdepsDiff { defns :: GNamespaceTreeDiff k referent reference renderedTerm renderedType termDiff typeDiff, libdeps :: Map NameSegment (DiffOp libdep) }