forked from GitHub/gf-core
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:
@@ -42,11 +42,12 @@ getSourceModule opts file0 =
|
|||||||
raw <- liftIO $ keepTemp tmp
|
raw <- liftIO $ keepTemp tmp
|
||||||
--ePutStrLn $ "1 "++file0
|
--ePutStrLn $ "1 "++file0
|
||||||
(optCoding,parsed) <- parseSource opts pModDef raw
|
(optCoding,parsed) <- parseSource opts pModDef raw
|
||||||
|
let indentLines = unlines . map (" "++) . lines
|
||||||
case parsed of
|
case parsed of
|
||||||
Left (Pn l c,msg) -> do file <- liftIO $ writeTemp tmp
|
Left (Pn l c,msg) -> do file <- liftIO $ writeTemp tmp
|
||||||
cwd <- getCurrentDirectory
|
cwd <- getCurrentDirectory
|
||||||
let location = makeRelative cwd file++":"++show l++":"++show c
|
let location = makeRelative cwd file++":"++show l++":"++show c
|
||||||
raise (location++":\n "++msg)
|
raise (location++":\n" ++ indentLines msg)
|
||||||
Right (i,mi0) ->
|
Right (i,mi0) ->
|
||||||
do liftIO $ removeTemp tmp
|
do liftIO $ removeTemp tmp
|
||||||
let mi =mi0 {mflags=mflags mi0 `addOptions` opts, msrc=file0}
|
let mi =mi0 {mflags=mflags mi0 `addOptions` opts, msrc=file0}
|
||||||
|
|||||||
Reference in New Issue
Block a user