Skip to content

Commit da1d928

Browse files
committed
Use showInfoError from EmacsTop rather than duplicating it here
1 parent a317504 commit da1d928

File tree

1 file changed

+1
-32
lines changed

1 file changed

+1
-32
lines changed

src/Agda/Convert.hs

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import qualified Agda.IR as IR
99
import Agda.Interaction.Base
1010
import Agda.Interaction.BasicOps as B
1111
import Agda.Interaction.EmacsCommand (Lisp)
12+
import Agda.Interaction.EmacsTop (showInfoError)
1213
import Agda.Interaction.Highlighting.Common (chooseHighlightingMethod, toAtoms)
1314
import Agda.Interaction.Highlighting.Precise (Aspects (..), DefinitionSite (..), HighlightingInfo, TokenBased (..))
1415
import qualified Agda.Interaction.Highlighting.Range as Highlighting
@@ -351,38 +352,6 @@ lispifyGoalSpecificDisplayInfo ii kind = localTCState $
351352

352353
--------------------------------------------------------------------------------
353354

354-
-- | Serializing Info_Error
355-
showInfoError :: Info_Error -> TCM String
356-
showInfoError (Info_GenericError err) = do
357-
e <- prettyError err
358-
w <- prettyTCWarnings' =<< getAllWarningsOfTCErr err
359-
360-
let errorMsg =
361-
if null w
362-
then e
363-
else delimiter "Error" ++ "\n" ++ e
364-
let warningMsg =
365-
List.intercalate "\n" $
366-
delimiter "Warning(s)" :
367-
filter (not . null) w
368-
return $
369-
if null w
370-
then errorMsg
371-
else errorMsg ++ "\n\n" ++ warningMsg
372-
showInfoError (Info_CompilationError warnings) = do
373-
s <- prettyTCWarnings warnings
374-
return $
375-
unlines
376-
[ "You need to fix the following errors before you can compile",
377-
"the module:",
378-
"",
379-
s
380-
]
381-
showInfoError (Info_HighlightingParseError ii) =
382-
return $ "Highlighting failed to parse expression in " ++ show ii
383-
showInfoError (Info_HighlightingScopeCheckError ii) =
384-
return $ "Highlighting failed to scope check expression in " ++ show ii
385-
386355
#if !MIN_VERSION_Agda(2,6,3)
387356
explainWhyInScope ::
388357
String ->

0 commit comments

Comments
 (0)