Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update links to wiki #2476

Merged
merged 1 commit into from
Dec 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/Language/PureScript/Errors.hs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ onTypesInErrorMessageM f (ErrorMessage hints simple) = ErrorMessage <$> traverse
gTypeSearch (TSBefore env) = pure (TSBefore env)
gTypeSearch (TSAfter result) = TSAfter <$> traverse (traverse f) result

wikiUri :: ErrorMessage -> Text
wikiUri e = "https://github.com/purescript/purescript/wiki/Error-Code-" <> errorCode e
errorDocUri :: ErrorMessage -> Text
errorDocUri e = "https://github.com/purescript/documentation/blob/master/errors/" <> errorCode e <> ".md"

-- TODO Other possible suggestions:
-- WildcardInferredType - source span not small enough
Expand Down Expand Up @@ -373,7 +373,7 @@ data PPEOptions = PPEOptions
{ ppeCodeColor :: Maybe (ANSI.ColorIntensity, ANSI.Color) -- ^ Color code with this color... or not
, ppeFull :: Bool -- ^ Should write a full error message?
, ppeLevel :: Level -- ^ Should this report an error or a warning?
, ppeShowWiki :: Bool -- ^ Should show a link to error message's wiki page?
, ppeShowDocs :: Bool -- ^ Should show a link to error message's doc page?
}

-- | Default options for PPEOptions
Expand All @@ -382,15 +382,15 @@ defaultPPEOptions = PPEOptions
{ ppeCodeColor = Just defaultCodeColor
, ppeFull = False
, ppeLevel = Error
, ppeShowWiki = True
, ppeShowDocs = True
}


-- |
-- Pretty print a single error, simplifying if necessary
--
prettyPrintSingleError :: PPEOptions -> ErrorMessage -> Box.Box
prettyPrintSingleError (PPEOptions codeColor full level showWiki) e = flip evalState defaultUnknownMap $ do
prettyPrintSingleError (PPEOptions codeColor full level showDocs) e = flip evalState defaultUnknownMap $ do
em <- onTypesInErrorMessageM replaceUnknowns (if full then e else simplifyErrorMessage e)
um <- get
return (prettyPrintErrorMessage um em)
Expand All @@ -405,10 +405,10 @@ prettyPrintSingleError (PPEOptions codeColor full level showWiki) e = flip evalS
] ++
maybe [] (return . Box.moveDown 1) typeInformation ++
[ Box.moveDown 1 $ paras
[ line $ "See " <> wikiUri e <> " for more information, "
[ line $ "See " <> errorDocUri e <> " for more information, "
, line $ "or to contribute content related to this " <> levelText <> "."
]
| showWiki
| showDocs
]
where
typeInformation :: Maybe Box.Box
Expand Down
2 changes: 1 addition & 1 deletion src/Language/PureScript/Errors/JSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ toJSONError verbose level e =
JSONError (toErrorPosition <$> sspan)
(P.renderBox (P.prettyPrintSingleError (P.PPEOptions Nothing verbose level False) (P.stripModuleAndSpan e)))
(P.errorCode e)
(P.wikiUri e)
(P.errorDocUri e)
(P.spanName <$> sspan)
(P.runModuleName <$> P.errorModule e)
(toSuggestion e)
Expand Down
6 changes: 3 additions & 3 deletions src/Language/PureScript/Interactive/Message.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ helpMessage = "The following commands are available:\n\n " ++
]

extraHelp =
"Further information is available on the PureScript wiki:\n" ++
" --> https://github.com/purescript/purescript/wiki/psci"
"Further information is available on the PureScript documentation repository:\n" ++
" --> https://github.com/purescript/documentation/blob/master/PSCi.md"

-- | The welcome prologue.
prologueMessage :: String
Expand All @@ -48,7 +48,7 @@ supportModuleMessage = unlines
, ""
, " psc-package install psci-support"
, ""
, "For help getting started, visit http://wiki.purescript.org/PSCi"
, "For help getting started, visit https://github.com/purescript/documentation/blob/master/PSCi.md"
]

-- | The quit message.
Expand Down