Skip to content

Commit

Permalink
further drive home the incompatibility of mismatched TTC versions whe…
Browse files Browse the repository at this point in the history
…n listing all packages
  • Loading branch information
mattpolzin committed Dec 17, 2024
1 parent 1316f58 commit aa09193
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion src/Idris/Package.idr
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,6 @@ reason : Maybe PkgVersion -> String
reason Nothing = "no matching version is installed"
reason (Just x) = "assigned version \{show x} which is out of bounds"


printResolutionError : ResolutionError -> String
printResolutionError (MkRE ds d v) = go [<] ds
where go : SnocList String -> List Candidate -> String
Expand Down
8 changes: 4 additions & 4 deletions src/Idris/SetOptions.idr
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ listPackages
pkgTTCVersions (MkPkgDir _ _ _ ttcVersions) =
pretty0 "├ TTC Versions:" <++> prettyTTCVersions
where
colorize : Int -> Doc IdrisAnn
colorize version =
annotate : Int -> Doc IdrisAnn
annotate version =
if version == ttcVersion
then pretty0 $ show version
else warning (pretty0 $ show version)
else warning ((pretty0 $ show version) <++> (parens "incompatible"))

prettyTTCVersions : Doc IdrisAnn
prettyTTCVersions = (concatWith (\x,y => x <+> "," <++> y)) $ colorize <$> sort ttcVersions
prettyTTCVersions = (concatWith (\x,y => x <+> "," <++> y)) $ annotate <$> sort ttcVersions

pkgPath : String -> Doc IdrisAnn
pkgPath path = pretty0 "└ \{path}"
Expand Down

0 comments on commit aa09193

Please sign in to comment.