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

Safe HaskellNone

Language.Haskell.HBB.Internal.Lexer

Synopsis

Documentation

getVariableIdUsingLexerAt :: GhcMonad m => (FilePath, BufLoc) -> IncludeQualified -> m (Either LexingFailReason (String, RealSrcSpan))Source

This function uses GHCs lexer to determine the token that is under the cursor (the passed SrcLoc).

Currently only the tokens ITvarid (a variable id) and ITqvarid (a qualified variable id) are supported. If IncludeQualified euqal ExcludeQualifiedVars then ITqvarid will be ignored. A token of type ITqvarid has two strings attached, the name of the module (the qualifier) and the name of the variable. Of these twos only the name is contained by the result.

data LexingFailReason Source

This type holds possible return values of getVariableIdUsingLexerAt.

Constructors

LexingFailed 
VarNotFound