Indent each line of an error message

By indenting each line instead of just the first, we simplify
the work of the gf-lsp parser, so we can see which errors are the same
This commit is contained in:
Andreas Källberg
2023-09-25 09:53:59 +02:00
parent 318b710a14
commit 268a25f59c

View File

@@ -42,11 +42,12 @@ getSourceModule opts file0 =
raw <- liftIO $ keepTemp tmp
--ePutStrLn $ "1 "++file0
(optCoding,parsed) <- parseSource opts pModDef raw
let indentLines = unlines . map (" "++) . lines
case parsed of
Left (Pn l c,msg) -> do file <- liftIO $ writeTemp tmp
cwd <- getCurrentDirectory
let location = makeRelative cwd file++":"++show l++":"++show c
raise (location++":\n "++msg)
raise (location++":\n" ++ indentLines msg)
Right (i,mi0) ->
do liftIO $ removeTemp tmp
let mi =mi0 {mflags=mflags mi0 `addOptions` opts, msrc=file0}