Language.Haskell.GhcMod.FileMapping

ghc-mod-5.8.0.0: Happy Haskell Hacking

Safe Haskell | None
Language | Haskell2010

Language.Haskell.GhcMod.FileMapping

Synopsis

- loadMappedFile :: IOish m => FilePath -> FilePath -> GhcModT m ()
- loadMappedFileSource :: IOish m => FilePath -> String -> GhcModT m ()
- unloadMappedFile :: IOish m => FilePath -> GhcModT m ()
- mapFile :: (IOish m, GmState m) => HscEnv -> Target -> m Target
- fileModSummaryWithMapping :: (IOish m, GmState m, GhcMonad m, GmEnv m) => FilePath -> m ModSummary

# Documentation

loadMappedFile #

Arguments

:: IOish m |
=> FilePath | 'from', file that will be mapped
-> FilePath | 'to', file to take source from
-> GhcModT m () |

maps `FilePath`, given as first argument to take source from `FilePath` given as second argument. Works exactly the same as first form of `--map-file` CLI option.

'from' can be either full path, or path relative to project root. 'to' has to be either relative to project root, or full path (preferred)

loadMappedFileSource #

Arguments

:: IOish m |
=> FilePath | 'from', file that will be mapped
-> String | 'src', source
-> GhcModT m () |

maps `FilePath`, given as first argument to have source as given by second argument.

'from' may or may not exist, and should be either full path, or relative to project root.

unloadMappedFile #

Arguments

:: IOish m |
=> FilePath | 'file', file to unmap
-> GhcModT m () |

unloads previously mapped file 'file', so that it's no longer mapped, and removes any temporary files created when file was mapped.

'file' should be either full path, or relative to project root.

mapFile :: (IOish m, GmState m) => HscEnv -> Target -> m Target #

fileModSummaryWithMapping :: (IOish m, GmState m, GhcMonad m, GmEnv m) => FilePath -> m ModSummary #