purescript-0.15.12: PureScript Programming Language Compiler

Safe Haskell | Safe-Inferred
Language | Haskell2010

Language.PureScript.Ide.SourceFile

Description

Getting declarations from PureScript sourcefiles

Synopsis

- parseModulesFromFiles :: (MonadIO m, MonadError IdeError m) => [FilePath] -> m [Either FilePath (FilePath, Module)]
- extractAstInformation :: Module -> (DefinitionSites SourceSpan, TypeAnnotations)
- extractSpans :: Declaration -> [(IdeNamespaced, SourceSpan)]
- extractTypeAnnotations :: [Declaration] -> [(Ident, SourceType)]

# Documentation

parseModulesFromFiles :: (MonadIO m, MonadError IdeError m) => [FilePath] -> m [Either FilePath (FilePath, Module)] #

extractAstInformation :: Module -> (DefinitionSites SourceSpan, TypeAnnotations) #

Extracts AST information from a parsed module

extractSpans #

Arguments

:: Declaration | The declaration to extract spans from
-> [(IdeNamespaced, SourceSpan)] | Declarations and their source locations

Given a surrounding Sourcespan and a Declaration from the PS AST, extracts definition sites inside that Declaration.

extractTypeAnnotations :: [Declaration] -> [(Ident, SourceType)] #

Extracts type annotations for functions from a given Module