Safe Haskell | None |
---|---|
Language | GHC2021 |
Development.IDE.Import.DependencyInformation
Synopsis
- data DependencyInformation = DependencyInformation {
- depErrorNodes :: !(FilePathIdMap (NonEmpty NodeError))
- depModules :: !(FilePathIdMap ShowableModule)
- depModuleDeps :: !(FilePathIdMap FilePathIdSet)
- depReverseModuleDeps :: !(IntMap IntSet)
- depPathIdMap :: !PathIdMap
- depBootMap :: !BootIdMap
- depModuleFiles :: !(ShowableModuleEnv FilePathId)
- depModuleGraph :: !ModuleGraph
- newtype ModuleImports = ModuleImports {
- moduleImports :: [(Located ModuleName, Maybe FilePathId)]
- data RawDependencyInformation = RawDependencyInformation {
- rawImports :: !(FilePathIdMap (Either ModuleParseError ModuleImports))
- rawPathIdMap :: !PathIdMap
- rawModuleMap :: !(FilePathIdMap ShowableModule)
- data NodeError
- data ModuleParseError = ModuleParseError
- newtype TransitiveDependencies = TransitiveDependencies {}
- newtype FilePathId = FilePathId {
- getFilePathId :: Int
- data NamedModuleDep = NamedModuleDep {}
- newtype ShowableModule = ShowableModule {}
- newtype ShowableModuleEnv a = ShowableModuleEnv {}
- data PathIdMap = PathIdMap {
- idToPathMap :: !(FilePathIdMap ArtifactsLocation)
- pathToIdMap :: !(HashMap NormalizedFilePath FilePathId)
- nextFreshId :: !Int
- emptyPathIdMap :: PathIdMap
- getPathId :: ArtifactsLocation -> PathIdMap -> (FilePathId, PathIdMap)
- lookupPathToId :: PathIdMap -> NormalizedFilePath -> Maybe FilePathId
- insertImport :: FilePathId -> Either ModuleParseError ModuleImports -> RawDependencyInformation -> RawDependencyInformation
- pathToId :: PathIdMap -> NormalizedFilePath -> Maybe FilePathId
- idToPath :: PathIdMap -> FilePathId -> NormalizedFilePath
- reachableModules :: DependencyInformation -> [NormalizedFilePath]
- processDependencyInformation :: RawDependencyInformation -> BootIdMap -> ModuleGraph -> DependencyInformation
- transitiveDeps :: DependencyInformation -> NormalizedFilePath -> Maybe TransitiveDependencies
- transitiveReverseDependencies :: NormalizedFilePath -> DependencyInformation -> Maybe [NormalizedFilePath]
- immediateReverseDependencies :: NormalizedFilePath -> DependencyInformation -> Maybe [NormalizedFilePath]
- lookupModuleFile :: Module -> DependencyInformation -> Maybe NormalizedFilePath
- type BootIdMap = FilePathIdMap FilePathId
- insertBootId :: FilePathId -> FilePathId -> BootIdMap -> BootIdMap
Documentation
data DependencyInformation #
Constructors
DependencyInformation | |
Fields
|
Instances
Generic DependencyInformation # | |||||
Defined in Development.IDE.Import.DependencyInformation Associated Types
Methods from :: DependencyInformation -> Rep DependencyInformation x # to :: Rep DependencyInformation x -> DependencyInformation # | |||||
Show DependencyInformation # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> DependencyInformation -> ShowS # show :: DependencyInformation -> String # showList :: [DependencyInformation] -> ShowS # | |||||
NFData DependencyInformation # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods rnf :: DependencyInformation -> () # | |||||
type Rep DependencyInformation # | |||||
Defined in Development.IDE.Import.DependencyInformation |
newtype ModuleImports #
The imports for a given module.
Constructors
ModuleImports | |
Fields
|
Instances
Show ModuleImports # | |
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> ModuleImports -> ShowS # show :: ModuleImports -> String # showList :: [ModuleImports] -> ShowS # |
data RawDependencyInformation #
Unprocessed results that we find by following imports recursively.
Constructors
RawDependencyInformation | |
Fields
|
Instances
Show RawDependencyInformation # | |
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> RawDependencyInformation -> ShowS # show :: RawDependencyInformation -> String # showList :: [RawDependencyInformation] -> ShowS # |
An error attached to a node in the dependency graph.
Constructors
PartOfCycle (Located ModuleName) [FilePathId] | This module is part of an import cycle. The module name corresponds to the import that enters the cycle starting from this module. The list of filepaths represents the elements in the cycle in unspecified order. |
FailedToLocateImport (Located ModuleName) | This module has an import that couldn’t be located. |
ParseError ModuleParseError | |
ParentOfErrorNode (Located ModuleName) | This module is the parent of a module that cannot be processed (either it cannot be parsed, is part of a cycle or the parent of another error node). |
Instances
data ModuleParseError #
This does not contain the actual parse error as that is already reported by GetParsedModule.
Constructors
ModuleParseError |
Instances
Generic ModuleParseError # | |||||
Defined in Development.IDE.Import.DependencyInformation Associated Types
Methods from :: ModuleParseError -> Rep ModuleParseError x # to :: Rep ModuleParseError x -> ModuleParseError # | |||||
Show ModuleParseError # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> ModuleParseError -> ShowS # show :: ModuleParseError -> String # showList :: [ModuleParseError] -> ShowS # | |||||
NFData ModuleParseError # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods rnf :: ModuleParseError -> () # | |||||
type Rep ModuleParseError # | |||||
newtype TransitiveDependencies #
Constructors
TransitiveDependencies | |
Fields
|
Instances
Generic TransitiveDependencies # | |||||
Defined in Development.IDE.Import.DependencyInformation Associated Types
Methods from :: TransitiveDependencies -> Rep TransitiveDependencies x # to :: Rep TransitiveDependencies x -> TransitiveDependencies # | |||||
Show TransitiveDependencies # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> TransitiveDependencies -> ShowS # show :: TransitiveDependencies -> String # showList :: [TransitiveDependencies] -> ShowS # | |||||
NFData TransitiveDependencies # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods rnf :: TransitiveDependencies -> () # | |||||
Eq TransitiveDependencies # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods (==) :: TransitiveDependencies -> TransitiveDependencies -> Bool # (/=) :: TransitiveDependencies -> TransitiveDependencies -> Bool # | |||||
type Rep TransitiveDependencies # | |||||
Defined in Development.IDE.Import.DependencyInformation type Rep TransitiveDependencies = D1 ('MetaData "TransitiveDependencies" "Development.IDE.Import.DependencyInformation" "ghcide-2.7.0.0-4RFlm38cSV494413rRqzNs" 'True) (C1 ('MetaCons "TransitiveDependencies" 'PrefixI 'True) (S1 ('MetaSel ('Just "transitiveModuleDeps") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [NormalizedFilePath]))) |
newtype FilePathId #
For processing dependency information, we need lots of maps and sets of filepaths. Comparing Strings is really slow, so we work with IntMap/IntSet instead and only convert at the edges.
Constructors
FilePathId | |
Fields
|
Instances
Show FilePathId # | |
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> FilePathId -> ShowS # show :: FilePathId -> String # showList :: [FilePathId] -> ShowS # | |
NFData FilePathId # | |
Defined in Development.IDE.Import.DependencyInformation Methods rnf :: FilePathId -> () # | |
Eq FilePathId # | |
Defined in Development.IDE.Import.DependencyInformation | |
Ord FilePathId # | |
Defined in Development.IDE.Import.DependencyInformation Methods compare :: FilePathId -> FilePathId -> Ordering # (<) :: FilePathId -> FilePathId -> Bool # (<=) :: FilePathId -> FilePathId -> Bool # (>) :: FilePathId -> FilePathId -> Bool # (>=) :: FilePathId -> FilePathId -> Bool # max :: FilePathId -> FilePathId -> FilePathId # min :: FilePathId -> FilePathId -> FilePathId # |
data NamedModuleDep #
Constructors
NamedModuleDep | |
Fields |
Instances
Generic NamedModuleDep # | |||||
Defined in Development.IDE.Import.DependencyInformation Associated Types
Methods from :: NamedModuleDep -> Rep NamedModuleDep x # to :: Rep NamedModuleDep x -> NamedModuleDep # | |||||
Show NamedModuleDep # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> NamedModuleDep -> ShowS # show :: NamedModuleDep -> String # showList :: [NamedModuleDep] -> ShowS # | |||||
NFData NamedModuleDep # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods rnf :: NamedModuleDep -> () # | |||||
Eq NamedModuleDep # | |||||
Defined in Development.IDE.Import.DependencyInformation Methods (==) :: NamedModuleDep -> NamedModuleDep -> Bool # (/=) :: NamedModuleDep -> NamedModuleDep -> Bool # | |||||
type Rep NamedModuleDep # | |||||
Defined in Development.IDE.Import.DependencyInformation type Rep NamedModuleDep = D1 ('MetaData "NamedModuleDep" "Development.IDE.Import.DependencyInformation" "ghcide-2.7.0.0-4RFlm38cSV494413rRqzNs" 'False) (C1 ('MetaCons "NamedModuleDep" 'PrefixI 'True) (S1 ('MetaSel ('Just "nmdFilePath") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 NormalizedFilePath) :*: (S1 ('MetaSel ('Just "nmdModuleName") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ModuleName) :*: S1 ('MetaSel ('Just "nmdModLocation") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe ModLocation))))) |
newtype ShowableModule #
Constructors
ShowableModule | |
Fields |
Instances
Show ShowableModule # | |
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> ShowableModule -> ShowS # show :: ShowableModule -> String # showList :: [ShowableModule] -> ShowS # | |
NFData ShowableModule # | |
Defined in Development.IDE.Import.DependencyInformation Methods rnf :: ShowableModule -> () # |
newtype ShowableModuleEnv a #
Constructors
ShowableModuleEnv | |
Fields |
Instances
Show a => Show (ShowableModuleEnv a) # | |
Defined in Development.IDE.Import.DependencyInformation Methods showsPrec :: Int -> ShowableModuleEnv a -> ShowS # show :: ShowableModuleEnv a -> String # showList :: [ShowableModuleEnv a] -> ShowS # | |
NFData a => NFData (ShowableModuleEnv a) # | |
Defined in Development.IDE.Import.DependencyInformation Methods rnf :: ShowableModuleEnv a -> () # |
Constructors
PathIdMap | |
Fields
|
getPathId :: ArtifactsLocation -> PathIdMap -> (FilePathId, PathIdMap) #
insertImport :: FilePathId -> Either ModuleParseError ModuleImports -> RawDependencyInformation -> RawDependencyInformation #
pathToId :: PathIdMap -> NormalizedFilePath -> Maybe FilePathId #
idToPath :: PathIdMap -> FilePathId -> NormalizedFilePath #
processDependencyInformation :: RawDependencyInformation -> BootIdMap -> ModuleGraph -> DependencyInformation #
transitiveDeps :: DependencyInformation -> NormalizedFilePath -> Maybe TransitiveDependencies #
returns all transitive dependencies in topological order.
transitiveReverseDependencies :: NormalizedFilePath -> DependencyInformation -> Maybe [NormalizedFilePath] #
Transitive reverse dependencies of a file
immediateReverseDependencies :: NormalizedFilePath -> DependencyInformation -> Maybe [NormalizedFilePath] #
Immediate reverse dependencies of a file
type BootIdMap = FilePathIdMap FilePathId #
insertBootId :: FilePathId -> FilePathId -> BootIdMap -> BootIdMap #