mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-02 08:53:07 +03:00
Fix deferred messages (#120)
* Test deferred error report message The text of the deferred {type errors, typed holes, out of scope variables} should call them 'error', instead it reports 'warning'. * Change warning to error in deferred messages
This commit is contained in:
parent
f9d4e0ffb9
commit
2879735a97
@ -154,7 +154,10 @@ unDefer (Reason Opt_WarnDeferredOutOfScopeVariables, fd) = upgradeWarningToError
|
||||
unDefer ( _ , fd) = fd
|
||||
|
||||
upgradeWarningToError :: FileDiagnostic -> FileDiagnostic
|
||||
upgradeWarningToError (nfp, fd) = (nfp, fd{_severity = Just DsError})
|
||||
upgradeWarningToError (nfp, fd) =
|
||||
(nfp, fd{_severity = Just DsError, _message = warn2err $ _message fd}) where
|
||||
warn2err :: T.Text -> T.Text
|
||||
warn2err = T.intercalate ": error:" . T.splitOn ": warning:"
|
||||
|
||||
addRelativeImport :: ParsedModule -> DynFlags -> DynFlags
|
||||
addRelativeImport modu dflags = dflags
|
||||
|
@ -117,9 +117,10 @@ diagnosticTests = testGroup "diagnostics"
|
||||
_ <- openDoc' "B.hs" "haskell" sourceB
|
||||
expectDiagnostics $ expectedDs message
|
||||
in
|
||||
[ deferralTest "type error" "True" "Couldn't match expected type"
|
||||
, deferralTest "typed hole" "_" "Found hole"
|
||||
, deferralTest "out of scope var" "unbound" "Variable not in scope"
|
||||
[ deferralTest "type error" "True" "Couldn't match expected type"
|
||||
, deferralTest "typed hole" "_" "Found hole"
|
||||
, deferralTest "out of scope var" "unbound" "Variable not in scope"
|
||||
, deferralTest "message shows error" "True" "A.hs:3:5: error:"
|
||||
]
|
||||
|
||||
, testSession "remove required module" $ do
|
||||
|
Loading…
Reference in New Issue
Block a user