buildwrapper-0.5.1: A library and an executable that provide an easy API for a Haskell IDE

Safe HaskellSafe-Infered

Language.Haskell.BuildWrapper.Base

Synopsis

Documentation

data BuildWrapperState Source

the state we keep

Constructors

BuildWrapperState 

Fields

tempFolder :: String

name of temporary folder

cabalPath :: FilePath

path to the cabal executable

cabalFile :: FilePath

path of the project cabal file

verbosity :: Verbosity

verbosity of logging

cabalFlags :: String

flags to pass cabal

cabalOpts :: [String]

extra arguments to cabal configure

data BWNoteStatus Source

status of notes: error or warning

Constructors

BWError 
BWWarning 

data BWLocation Source

location of a note/error

Constructors

BWLocation 

Fields

bwl_src :: FilePath

source file

bwl_line :: Int

line

bwl_col :: Int

column

data BWNote Source

a note on a source file

Constructors

BWNote 

Fields

bwn_status :: BWNoteStatus

status of the note

bwn_title :: String

message

bwn_location :: BWLocation

where the note is

type OpResult a = (a, [BWNote])Source

simple type encapsulating the fact the operations return along with notes generated on files

data BuildResult Source

result: success + files impacted

Constructors

BuildResult Bool [FilePath] 

data WhichCabal Source

which cabal file to use operations

Constructors

Source

use proper file

Target

use temporary file that was saved in temp folder

data InFileLoc Source

Location inside a file, the file is known and doesn't need to be repeated

Constructors

InFileLoc 

Fields

ifl_line :: Int

line

ifl_column :: Int

column

data InFileSpan Source

Span inside a file, the file is known and doesn't need to be repeated

Constructors

InFileSpan 

Fields

ifs_start :: InFileLoc

start location

ifs_end :: InFileLoc

end location

mkFileSpanSource

Arguments

:: Int

start line

-> Int

start column

-> Int

end line

-> Int

end column

-> InFileSpan 

construct a file span

data OutlineDef Source

element of the outline result

Constructors

OutlineDef 

Fields

od_name :: Text

name

od_type :: [OutlineDefType]

types: can have several to combine

od_loc :: InFileSpan

span in source

od_children :: [OutlineDef]

children (constructors...)

od_signature :: Maybe Text

type signature if any

od_comment :: Maybe Text

comment if any

mkOutlineDefSource

Arguments

:: Text

name

-> [OutlineDefType]

types: can have several to combine

-> InFileSpan

span in source

-> OutlineDef 

constructs an OutlineDef with no children and no type signature

mkOutlineDefWithChildrenSource

Arguments

:: Text

name

-> [OutlineDefType]

types: can have several to combine

-> InFileSpan

span in source

-> [OutlineDef]

children (constructors...)

-> OutlineDef 

constructs an OutlineDef with children and no type signature

data TokenDef Source

Lexer token

Constructors

TokenDef 

Fields

td_name :: Text

type of token

td_loc :: InFileSpan

location

data ImportExportType Source

Type of import/export directive

Constructors

IEVar

Var

IEAbs

Abs

IEThingAll

import/export everythin

IEThingWith

specific import/export list

IEModule

reexport module

data ExportDef Source

definition of export

Constructors

ExportDef 

Fields

e_name :: Text

name

e_type :: ImportExportType

type

e_loc :: InFileSpan

location in source file

e_children :: [Text]

children (constructor names, etc.)

data ImportSpecDef Source

definition of an import element

Constructors

ImportSpecDef 

Fields

is_name :: Text

name

is_type :: ImportExportType

type

is_loc :: InFileSpan

location in source file

is_children :: [Text]

children (constructor names, etc.)

data ImportDef Source

definition of an import statement

Constructors

ImportDef 

Fields

i_module :: Text

module name

i_loc :: InFileSpan

location in source file

i_qualified :: Bool

is the import qualified

i_hiding :: Bool

is the import element list for hiding or exposing

i_alias :: Text

alias name

i_children :: Maybe [ImportSpecDef]

specific import elements

data OutlineResult Source

complete result for outline

Constructors

OutlineResult 

Fields

or_outline :: [OutlineDef]

outline contents

or_exports :: [ExportDef]

exports

or_imports :: [ImportDef]

imports

data BuildFlags Source

build flags for a specific file

Constructors

BuildFlags 

Fields

bf_ast :: [String]

flags for GHC

bf_preproc :: [String]

flags for preprocessor

bf_modName :: Maybe String

module name if known

getFullTempDir :: BuildWrapper FilePathSource

get the full path for the temporary directory

getDistDir :: BuildWrapper FilePathSource

get the full path for the temporary dist directory (where cabal will write its output)

getTargetPathSource

Arguments

:: FilePath

relative path of source file

-> BuildWrapper FilePath 

get full path in temporary folder for source file (i.e. where we're going to write the temporary contents of an edited file)

canonicalizeFullPathSource

Arguments

:: FilePath

relative path of source file

-> BuildWrapper FilePath 

get the full, canonicalized path of a source

getFullSrcSource

Arguments

:: FilePath

relative path of source file

-> BuildWrapper FilePath 

get the full path of a source

copyFromMainSource

Arguments

:: Bool

copy even if temp file is newer

-> FilePath

relative path of source file

-> BuildWrapper (Maybe FilePath)

return Just the file if copied, Nothing if no copy was done

copy a file from the normal folders to the temp folder

fileToModule :: FilePath -> StringSource

replace relative file path by module name

data CabalComponent Source

component in cabal file

Constructors

CCLibrary

library

Fields

cc_buildable :: Bool

is the test suite buildable

is the executable buildable

is the library buildable

CCExecutable

executable

Fields

cc_exe_name :: String

executable name

cc_buildable :: Bool

is the test suite buildable

is the executable buildable

is the library buildable

CCTestSuite

test suite

Fields

cc_test_name :: String

test suite name

cc_buildable :: Bool

is the test suite buildable

is the executable buildable

is the library buildable

data CabalPackage Source

a cabal package

Constructors

CabalPackage 

Fields

cp_name :: String

name of package

cp_version :: String

version

cp_exposed :: Bool

is the package exposed or hidden

cp_dependent :: [CabalComponent]

components in the cabal file that use this package

cp_modules :: [String]

all modules. We keep all modules so that we can try to open non exposed but imported modules directly

getRecursiveContents :: FilePath -> IO [FilePath]Source

http:book.realworldhaskell.orgreadio-case-study-a-library-for-searching-the-filesystem.html

fromJustDebug :: String -> Maybe a -> aSource

debug method: fromJust with a message to display when we get Nothing

removeBaseDir :: FilePath -> String -> StringSource

remove a base directory from a string representing a full path