on master help sign in
Expose Reporting.Helpers.makeLink and some cosmetic stuff
f2b3e46Evan Czaplicki
src/Reporting/Helpers.hs+7−14
@@ -5,7 +5,7 @@ module Reporting.Helpers
5 , nameToDoc
5 , nameToDoc
6 , args, moreArgs
6 , args, moreArgs
7 , toSimpleNote, toSimpleHint, toFancyHint
7 , toSimpleNote, toSimpleHint, toFancyHint
8− , link, reflowLink
8+ , link, reflowLink, makeLink
9 , stack, reflow
9 , stack, reflow
10 , commaSep, capitalize, ordinalize, drawCycle
10 , commaSep, capitalize, ordinalize, drawCycle
11 , findPotentialTypos, findTypoPairs, vetTypos
11 , findPotentialTypos, findTypoPairs, vetTypos
@@ -88,7 +88,7 @@ link word before fileName after =
88
88
89makeLink :: String -> String
89makeLink :: String -> String
90makeLink fileName =
90makeLink fileName =
91− "<http://elm-lang.org/hints/" <> Pkg.versionToString Compiler.version <> "/" <> fileName <> ".md>"
91+ "<https://elm-lang.org/hints/" <> Pkg.versionToString Compiler.version <> "/" <> fileName <> ">"
92
92
93
93
94reflowLink :: String -> String -> String -> Doc
94reflowLink :: String -> String -> String -> Doc
@@ -164,17 +164,10 @@ ordinalize number =
164drawCycle :: [N.Name] -> Doc
164drawCycle :: [N.Name] -> Doc
165drawCycle names =
165drawCycle names =
166 let
166 let
167− topLine =
167+ topLine = "┌─────┐"
168− "┌─────┐"
169−
170− nameLine name =
168+ nameLine name = "│ " <> dullyellow (nameToDoc name)
171− "│ " <> dullyellow (textToDoc name)
172−
173− midLine =
169+ midLine = "│ ↓"
174− "│ ↓"
175−
176− bottomLine =
170+ bottomLine = "└─────┘"
177− "└─────┘"
178 in
171 in
179 vcat (topLine : List.intersperse midLine (map nameLine names) ++ [ bottomLine ])
172 vcat (topLine : List.intersperse midLine (map nameLine names) ++ [ bottomLine ])
180
173
@@ -185,7 +178,7 @@ drawCycle names =
185
178
186findPotentialTypos :: [String] -> String -> [String]
179findPotentialTypos :: [String] -> String -> [String]
187findPotentialTypos knownNames badName =
180findPotentialTypos knownNames badName =
188− filter ((==1) . distance badName) knownNames
181+ filter (\name -> distance badName name == 1) knownNames
189
182
190
183
191findTypoPairs :: [String] -> [String] -> [(String, String)]
184findTypoPairs :: [String] -> [String] -> [(String, String)]