Module

Psa

Re-exports from Psa.Output

#OutputStats

type OutputStats = { allErrors :: Object (Tuple Int Int), allWarnings :: Object (Tuple Int Int), libErrors :: Object (Tuple Int Int), libWarnings :: Object (Tuple Int Int), srcErrors :: Object (Tuple Int Int), srcWarnings :: Object (Tuple Int Int) }

Statistics are a ratio of errors shown to errors in total.

#Output

type Output = { errors :: Array PsaAnnotedError, stats :: OutputStats, warnings :: Array PsaAnnotedError }

#trimPosition

trimPosition :: Lines -> Position -> Position

Finds the true bounds of the source. The PureScript compiler is greedy when it comes to matching whitespace at the end of an expression, so the original source bounds always includes whitespace and comments.

#trimMessage

trimMessage :: String -> String

Trims extraneous whitespace from psc error messages.

#output

output :: forall m. Monad m => (Filename -> Position -> m (Maybe Lines)) -> PsaOptions -> PsaResult -> m Output

Annotates a error/warning result set with original source lines, better positions, and semantic paths (lib vs src). The callback should load the requested set of lines from the absolute filename based on the tentative position information.

Re-exports from Psa.Types

#Suggestion

type Suggestion = { replaceRange :: Maybe Position, replacement :: String }

#StatVerbosity

#PsaResult

type PsaResult = { errors :: Array PsaError, warnings :: Array PsaError }

#PsaPath

data PsaPath

Relative files paths from the cwd, tagged as either being part of the source files or library files of a project. The Unknown variant exists because some psc errors are inter-module and aren't reported with a canonical file.

Constructors

Instances

#PsaOptions

type PsaOptions = { ansi :: Boolean, censorCodes :: Set ErrorCode, censorLib :: Boolean, censorSrc :: Boolean, censorWarnings :: Boolean, cwd :: String, filterCodes :: Set ErrorCode, libDirs :: Array String, statVerbosity :: StatVerbosity, strict :: Boolean }

#PsaError

type PsaError = { errorCode :: ErrorCode, errorLink :: String, filename :: Maybe Filename, message :: String, moduleName :: Maybe ModuleName, position :: Maybe Position, suggestion :: Maybe Suggestion }

#PsaAnnotedError

type PsaAnnotedError = { error :: PsaError, message :: String, path :: PsaPath, position :: Maybe Position, source :: Maybe Lines }

#Position

type Position = { endColumn :: Int, endLine :: Int, startColumn :: Int, startLine :: Int }

#ModuleName

#Lines

#Filename

#ErrorCode

#encodePsaResult

#encodePsaError

Modules