hiedb-0.6.0.0: Generates a references DB from .hie files

Safe Haskell | None
Language | Haskell2010

HieDb.Query

Synopsis

- getAllIndexedMods :: HieDb -> IO [HieModuleRow]
- getAllIndexedExports :: HieDb -> IO [ExportRow]
- getExportsForModule :: HieDb -> ModuleName -> IO [ExportRow]
- findExporters :: HieDb -> OccName -> ModuleName -> Unit -> IO [ModuleName]
- resolveUnitId :: HieDb -> ModuleName -> IO (Either HieDbErr Unit)
- findReferences :: HieDb -> Bool -> OccName -> Maybe ModuleName -> Maybe Unit -> [FilePath] -> IO [Res RefRow]
- lookupPackage :: HieDb -> Unit -> IO [HieModuleRow]
- lookupHieFile :: HieDb -> ModuleName -> Unit -> IO (Maybe HieModuleRow)
- lookupHieFileFromSource :: HieDb -> FilePath -> IO (Maybe HieModuleRow)
- lookupHieFileFromHash :: HieDb -> Fingerprint -> IO (Maybe HieModuleRow)
- findTypeRefs :: HieDb -> Bool -> OccName -> Maybe ModuleName -> Maybe Unit -> [FilePath] -> IO [Res TypeRef]
- findDef :: HieDb -> OccName -> Maybe ModuleName -> Maybe Unit -> IO [Res DefRow]
- findOneDef :: HieDb -> OccName -> Maybe ModuleName -> Maybe Unit -> IO (Either HieDbErr (Res DefRow))
- searchDef :: HieDb -> String -> IO [Res DefRow]
- withTarget :: HieDb -> HieTarget -> (HieFile -> a) -> IO (Either HieDbErr a)
- type Vertex = (String, String, String, Int, Int, Int, Int)
- declRefs :: HieDb -> IO ()
- getGraph :: HieDb -> IO (AdjacencyMap Vertex)
- getVertices :: HieDb -> [Symbol] -> IO [Vertex]
- getReachable :: HieDb -> [Symbol] -> IO [Vertex]
- getUnreachable :: HieDb -> [Symbol] -> IO [Vertex]
- html :: (NameCacheMonad m, MonadIO m) => HieDb -> [Symbol] -> m ()
- getAnnotations :: HieDb -> [Symbol] -> IO (Map FilePath (ModuleName, Set Span))
- getReachableUnreachable :: HieDb -> [Symbol] -> IO ([Vertex], [Vertex])
- splitByReachability :: Ord a => AdjacencyMap a -> [a] -> (Set a, Set a)

# Documentation

getAllIndexedMods :: HieDb -> IO [HieModuleRow] #

List all modules indexed in HieDb.

getAllIndexedExports :: HieDb -> IO [ExportRow] #

List all module exports

getExportsForModule :: HieDb -> ModuleName -> IO [ExportRow] #

List all exports of the given module

findExporters :: HieDb -> OccName -> ModuleName -> Unit -> IO [ModuleName] #

Find all the modules that export an identifier |

resolveUnitId :: HieDb -> ModuleName -> IO (Either HieDbErr Unit) #

Lookup Unit associated with given ModuleName. HieDbErr is returned if no module with given name has been indexed or if ModuleName is ambiguous (i.e. there are multiple packages containing module with given name)

findReferences :: HieDb -> Bool -> OccName -> Maybe ModuleName -> Maybe Unit -> [FilePath] -> IO [Res RefRow] #

lookupPackage :: HieDb -> Unit -> IO [HieModuleRow] #

Lookup all `HieModule` rows from `HieDb` that are part of a given `Unit`

lookupHieFile :: HieDb -> ModuleName -> Unit -> IO (Maybe HieModuleRow) #

Lookup `HieModule` row from `HieDb` given its `ModuleName` and `Unit`

lookupHieFileFromSource :: HieDb -> FilePath -> IO (Maybe HieModuleRow) #

Lookup `HieModule` row from `HieDb` given the path to the Haskell source file

lookupHieFileFromHash :: HieDb -> Fingerprint -> IO (Maybe HieModuleRow) #

Lookup `HieModule` row from `HieDb` given the hash of the HIE file

findTypeRefs :: HieDb -> Bool -> OccName -> Maybe ModuleName -> Maybe Unit -> [FilePath] -> IO [Res TypeRef] #

findDef :: HieDb -> OccName -> Maybe ModuleName -> Maybe Unit -> IO [Res DefRow] #

findOneDef :: HieDb -> OccName -> Maybe ModuleName -> Maybe Unit -> IO (Either HieDbErr (Res DefRow)) #

searchDef :: HieDb -> String -> IO [Res DefRow] #

withTarget :: HieDb -> HieTarget -> (HieFile -> a) -> IO (Either HieDbErr a) #

`withTarget db t f` runs function `f` with HieFile specified by HieTarget `t`. In case the target is given by ModuleName (and optionally Unit) it is first resolved from HieDb, which can lead to error if given file is not indexed/Module name is ambiguous.

type Vertex = (String, String, String, Int, Int, Int, Int) #

declRefs :: HieDb -> IO () #

getGraph :: HieDb -> IO (AdjacencyMap Vertex) #

getVertices :: HieDb -> [Symbol] -> IO [Vertex] #

getReachable :: HieDb -> [Symbol] -> IO [Vertex] #

getUnreachable :: HieDb -> [Symbol] -> IO [Vertex] #

html :: (NameCacheMonad m, MonadIO m) => HieDb -> [Symbol] -> m () #

getAnnotations :: HieDb -> [Symbol] -> IO (Map FilePath (ModuleName, Set Span)) #

getReachableUnreachable :: HieDb -> [Symbol] -> IO ([Vertex], [Vertex]) #

splitByReachability :: Ord a => AdjacencyMap a -> [a] -> (Set a, Set a) #