git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #1424 from mjgpy3/say_correct_level_in_link_text

In error/warning link text, correctly say "error" or "warning"

commit6bbe003a7f627430630c9ac11c2bc8d6a18b74da authorPhil Freeman <paf31@cantab.net> dateMon 24 Aug 2015, 20:42 (11 years ago) parentb1fd9ae7fbe93f
1 file changed+6−1
src/Language/PureScript/Errors.hs+6−1
src/Language/PureScript/Errors.hs+6−1
@@ -399,7 +399,7 @@ prettyPrintSingleError full level e = prettyPrintErrorMessage <$> onTypesInError
399399 prettyPrintErrorMessage em =
400400 paras $
401401 go em:suggestions em ++
402− [line $ "See " ++ wikiUri ++ " for more information, or to contribute content related to this error."]
402+ [line $ "See " ++ wikiUri ++ " for more information, or to contribute content related to this " ++ levelText ++ "."]
403403 where
404404 wikiUri :: String
405405 wikiUri = "https://github.com/purescript/purescript/wiki/Error-Code-" ++ errorCode e
@@ -736,6 +736,11 @@ prettyPrintSingleError full level e = prettyPrintErrorMessage <$> onTypesInError
736736 lineWithLevel :: String -> Box.Box
737737 lineWithLevel text = line $ show level ++ " " ++ text
738738
739+ levelText :: String
740+ levelText = case level of
741+ Error -> "error"
742+ Warning -> "warning"
743+
739744 suggestions :: ErrorMessage -> [Box.Box]
740745 suggestions = suggestions' . unwrapErrorMessage
741746 where