1{-# LANGUAGE OverloadedStrings #-}
5 , Compile.Artifacts(..)
15import qualified Data.ByteString as BS
16import qualified Data.Map as Map
17import qualified Data.Text as Text
19import qualified Compile
20import qualified Elm.Compiler.Module as M
21import qualified Elm.Compiler.Version
22import qualified Elm.Package as Pkg
23import qualified Json.Encode as Encode
24import qualified Reporting.Doc as D
25import qualified Reporting.Error as Error
26import qualified Reporting.Render.Code as Code
27import qualified Reporting.Region as Region
28import qualified Reporting.Report as Report
29import qualified Reporting.Result as Result
30import qualified Reporting.Warning as Warning
39 Elm.Compiler.Version.version
49 -> Map.Map M.Raw M.Canonical
52 -> ( [Warning.Warning], Either [Error.Error] Compile.Artifacts )
53compile docsFlag pkg importDict interfaces source =
54 Result.run $ Compile.compile docsFlag pkg importDict interfaces source
61errorsToDoc :: FilePath -> Text.Text -> [Error.Error] -> D.Doc
62errorsToDoc filePath source errors =
65 concatMap (Error.toReports (Code.toSource source)) errors
67 D.vcat $ map (Report.toDoc filePath) reports
74errorsToJson :: M.Raw -> FilePath -> Text.Text -> [Error.Error] -> Encode.Value
75errorsToJson moduleName filePath source errors =
78 concatMap (Error.toReports (Code.toSource source)) errors
81 [ ("path", Encode.text (Text.pack filePath))
82 , ("name", Encode.name moduleName)
83 , ("problems", Encode.array (map reportToJson reports))
87reportToJson :: Report.Report -> Encode.Value
88reportToJson (Report.Report title region _sgstns message) =
90 [ ("title", Encode.text (Text.pack title))
91 , ("region", Region.encode region)
92 , ("message", D.encode message)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list