libhbb-0.4.1.0: Backend for text editors to provide better Haskell editing support.

Safe HaskellNone

Language.Haskell.HBB.Locate

Synopsis

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.

showLocateResultSource

Arguments

:: (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.

data BufLoc Source

This is just the combination of a line number and a column number.

Constructors

BufLoc Int Int

BufLoc line column

Instances

Eq BufLoc 
Data BufLoc 
Ord BufLoc 
Show BufLoc

BufLocs are shown by separating the line and the column number by a colon.

Typeable BufLoc 

data BufSpan Source

A BufSpan is simply defined by two times a BufLoc.

Constructors

BufSpan BufLoc BufLoc

BufSpan startLoc endLoc

Instances

Eq BufSpan 
Data BufSpan 
Show BufSpan 
Typeable BufSpan