purescript-0.10.1: PureScript Programming Language Compiler

Safe HaskellNone
LanguageHaskell98

Language.PureScript.Ide.Imports

Description

Provides functionality to manage imports

Synopsis

Documentation

addImplicitImport Source #

Arguments

:: (MonadIO m, MonadError PscIdeError m) 
=> FilePath

The Sourcefile read from

-> ModuleName

The module to import

-> m [Text] 

Adds an implicit import like import Prelude to a Sourcefile.

addImportForIdentifier Source #

Arguments

:: (Ide m, MonadError PscIdeError m) 
=> FilePath

The Sourcefile to read from

-> Text

The identifier to import

-> [Filter]

Filters to apply before searching for the identifier

-> m (Either [Match IdeDeclaration] [Text]) 

Looks up the given identifier in the currently loaded modules.

  • Throws an error if the identifier cannot be found.
  • If exactly one match is found, adds an explicit import to the importsection
  • If more than one possible imports are found, reports the possibilities as a list of completions.

answerRequest :: MonadIO m => Maybe FilePath -> [Text] -> m Success Source #

Writes a list of lines to Just filepath and responds with a TextResult, or returns the lines as a MultilineTextResult if Nothing was given as the first argument.

parseImport :: Text -> Maybe Import Source #

Test and ghci helper