Safe Haskell | None |
---|
- getVariableIdUsingLexerAt :: GhcMonad m => (FilePath, BufLoc) -> IncludeQualified -> m (Either LexingFailReason (String, RealSrcSpan))
- data LexingFailReason
- data IncludeQualified
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.