Language.PureScript.Ide.Usage

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Language.PureScript.Ide.Usage

Synopsis

- findReexportingModules :: (ModuleName, IdeDeclaration) -> ModuleMap [IdeDeclarationAnn] -> [ModuleName]
- directDependants :: IdeDeclaration -> ModuleMap Module -> ModuleName -> ModuleMap (NonEmpty Search)
- eligibleModules :: (ModuleName, IdeDeclaration) -> ModuleMap [IdeDeclarationAnn] -> ModuleMap Module -> ModuleMap (NonEmpty Search)
- applySearch :: Module -> Search -> [SourceSpan]
- findUsages :: Ide m => IdeDeclaration -> ModuleName -> m (ModuleMap (NonEmpty SourceSpan))

# Documentation

findReexportingModules #

Arguments

:: (ModuleName, IdeDeclaration) | The declaration and the module it is defined in for which we are searching usages
-> ModuleMap [IdeDeclarationAnn] | Our declaration cache. Needs to have reexports resolved
-> [ModuleName] | All the modules that reexport the declaration. This does NOT include the defining module

directDependants :: IdeDeclaration -> ModuleMap Module -> ModuleName -> ModuleMap (NonEmpty Search) #

eligibleModules :: (ModuleName, IdeDeclaration) -> ModuleMap [IdeDeclarationAnn] -> ModuleMap Module -> ModuleMap (NonEmpty Search) #

applySearch :: Module -> Search -> [SourceSpan] #

Finds all usages for a given `Search` throughout a module

findUsages :: Ide m => IdeDeclaration -> ModuleName -> m (ModuleMap (NonEmpty SourceSpan)) #

How we find usages, given an IdeDeclaration and the module it was defined in:

1. Find all modules that reexport the given declaration
2. Find all modules that import from those modules, and while traversing the imports build a specification for how the identifier can be found in the module.
3. Apply the collected search specifications and collect the results