Safe Haskell | None |
---|
Documentation
locate :: [String] -> FilePath -> BufLoc -> IO (FilePath, BufSpan)Source
This function implements the mode locate
.
locate
takes the name of a file and a position within this file. If this
position points to a value or function binding this function returns the
source-range where the binding is defined. If the position doesn't point to
an according binding, the function will fail with an exception. In this
case nothing is written to standard output.
The first two command line parameters is:
- The GHC options as string list (as they should appear on the command
line, e.g.
["-isrc"]
)
locateM :: GhcMonad m => FilePath -> BufLoc -> m (FilePath, BufSpan)Source
This is a variant of locate that runs within the GHC monad and therefore allows a more fine-grained control over the behaviour of GHC.
:: (FilePath, BufSpan) | The position that should be converted to string |
-> String |
This function creates a string of the result returned by locate or locateM.
The string has exactly the format that should be understood by text editors that are using the mode locate.
This is just the combination of a line number and a column number.
BufLoc Int Int | BufLoc line column |