ide-backend 0.9.0.7 → 0.9.0.8
raw patch · 3 files changed
+66/−2 lines, 3 filesPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
API changes (from Hackage documentation)
- IdeSession: Binder :: IdScope
- IdeSession: BreakInfo :: ModuleName -> SourceSpan -> Type -> VariableEnv -> BreakInfo
- IdeSession: DataName :: IdNameSpace
- IdeSession: ExternalException :: String -> Maybe IOException -> ExternalException
- IdeSession: GHC_7_10 :: GhcVersion
- IdeSession: GHC_7_4 :: GhcVersion
- IdeSession: GHC_7_8 :: GhcVersion
- IdeSession: GlobalPackageDB :: PackageDB
- IdeSession: IdInfo :: UnpkIdProp -> SrictNotUnpackedIdScope -> IdInfo
- IdeSession: IdProp :: SrictNotUnpackedName -> SrictNotUnpackedIdNameSpace -> SrictNotUnpacked(Maybe Type) -> UnpkModuleId -> SrictNotUnpackedEitherSpan -> SrictNotUnpacked(Maybe ModuleId) -> IdProp
- IdeSession: Import :: SrictNotUnpackedModuleId -> SrictNotUnpacked(Maybe Text) -> SrictNotUnpackedBool -> SrictNotUnpackedBool -> SrictNotUnpacked(Maybe ModuleName) -> SrictNotUnpackedImportEntities -> Import
- IdeSession: ImportAll :: ImportEntities
- IdeSession: ImportHiding :: SrictNotUnpacked[Text] -> ImportEntities
- IdeSession: ImportOnly :: SrictNotUnpacked[Text] -> ImportEntities
- IdeSession: Imported :: UnpkModuleId -> SrictNotUnpackedEitherSpan -> SrictNotUnpackedText -> IdScope
- IdeSession: InvalidSessionStateQueries :: InvalidSessionStateQueries
- IdeSession: KindError :: SourceErrorKind
- IdeSession: KindServerDied :: SourceErrorKind
- IdeSession: KindWarning :: SourceErrorKind
- IdeSession: LicenseArgs :: PackageDBStack -> [FilePath] -> [String] -> FilePath -> FilePath -> FilePath -> [(String, (Maybe License, Maybe FilePath, Maybe String))] -> FilePath -> [PackageId] -> LicenseArgs
- IdeSession: Local :: IdScope
- IdeSession: ManagedFiles :: [FilePath] -> [FilePath] -> ManagedFiles
- IdeSession: ModuleId :: SrictNotUnpackedModuleName -> UnpkPackageId -> ModuleId
- IdeSession: PackageId :: SrictNotUnpackedText -> SrictNotUnpacked(Maybe Text) -> SrictNotUnpackedText -> PackageId
- IdeSession: Progress :: Int -> Int -> Maybe Text -> Maybe Text -> Progress
- IdeSession: ProperSpan :: UnpkSourceSpan -> EitherSpan
- IdeSession: RunActions :: IO (Either ByteString a) -> IO () -> (ByteString -> IO ()) -> IO () -> RunActions a
- IdeSession: RunBlockBuffering :: Maybe Int -> Maybe Int -> RunBufferMode
- IdeSession: RunBreak :: RunResult
- IdeSession: RunForceCancelled :: RunResult
- IdeSession: RunGhcException :: String -> RunResult
- IdeSession: RunLineBuffering :: Maybe Int -> RunBufferMode
- IdeSession: RunNoBuffering :: RunBufferMode
- IdeSession: RunOk :: RunResult
- IdeSession: RunProgException :: String -> RunResult
- IdeSession: SessionConfig :: FilePath -> [FilePath] -> InProcess -> Bool -> PackageDBStack -> [String] -> [(String, (Maybe License, Maybe FilePath, Maybe String))] -> (String -> IO ()) -> Bool -> SessionConfig
- IdeSession: SessionInitParams :: Maybe ByteString -> [String] -> [FilePath] -> Targets -> [String] -> SessionInitParams
- IdeSession: SourceError :: SrictNotUnpackedSourceErrorKind -> SrictNotUnpackedEitherSpan -> SrictNotUnpackedText -> SourceError
- IdeSession: SourceSpan :: SrictNotUnpackedFilePath -> UnpkInt -> UnpkInt -> UnpkInt -> UnpkInt -> SourceSpan
- IdeSession: SpanId :: IdInfo -> SpanInfo
- IdeSession: SpanQQ :: IdInfo -> SpanInfo
- IdeSession: SpecificPackageDB :: FilePath -> PackageDB
- IdeSession: TargetsExclude :: [FilePath] -> Targets
- IdeSession: TargetsInclude :: [FilePath] -> Targets
- IdeSession: TcClsName :: IdNameSpace
- IdeSession: TextSpan :: SrictNotUnpackedText -> EitherSpan
- IdeSession: TvName :: IdNameSpace
- IdeSession: UserPackageDB :: PackageDB
- IdeSession: VarName :: IdNameSpace
- IdeSession: WiredIn :: IdScope
- IdeSession: breakInfoModule :: BreakInfo -> ModuleName
- IdeSession: breakInfoResultType :: BreakInfo -> Type
- IdeSession: breakInfoSpan :: BreakInfo -> SourceSpan
- IdeSession: breakInfoVariableEnv :: BreakInfo -> VariableEnv
- IdeSession: configDeleteTempFiles :: SessionConfig -> Bool
- IdeSession: configDir :: SessionConfig -> FilePath
- IdeSession: configExtraPathDirs :: SessionConfig -> [FilePath]
- IdeSession: configGenerateModInfo :: SessionConfig -> Bool
- IdeSession: configInProcess :: SessionConfig -> InProcess
- IdeSession: configLicenseExc :: SessionConfig -> [String]
- IdeSession: configLicenseFixed :: SessionConfig -> [(String, (Maybe License, Maybe FilePath, Maybe String))]
- IdeSession: configLog :: SessionConfig -> String -> IO ()
- IdeSession: configPackageDBStack :: SessionConfig -> PackageDBStack
- IdeSession: dataFiles :: ManagedFiles -> [FilePath]
- IdeSession: errorKind :: SourceError -> SrictNotUnpackedSourceErrorKind
- IdeSession: errorMsg :: SourceError -> SrictNotUnpackedText
- IdeSession: errorSpan :: SourceError -> SrictNotUnpackedEitherSpan
- IdeSession: externalException :: ExternalException -> Maybe IOException
- IdeSession: externalStdErr :: ExternalException -> String
- IdeSession: forceCancel :: RunActions a -> IO ()
- IdeSession: idDefSpan :: IdProp -> SrictNotUnpackedEitherSpan
- IdeSession: idDefinedIn :: IdProp -> UnpkModuleId
- IdeSession: idHomeModule :: IdProp -> SrictNotUnpacked(Maybe ModuleId)
- IdeSession: idImportQual :: IdScope -> SrictNotUnpackedText
- IdeSession: idImportSpan :: IdScope -> SrictNotUnpackedEitherSpan
- IdeSession: idImportedFrom :: IdScope -> UnpkModuleId
- IdeSession: idName :: IdProp -> SrictNotUnpackedName
- IdeSession: idProp :: IdInfo -> UnpkIdProp
- IdeSession: idScope :: IdInfo -> SrictNotUnpackedIdScope
- IdeSession: idSpace :: IdProp -> SrictNotUnpackedIdNameSpace
- IdeSession: idType :: IdProp -> SrictNotUnpacked(Maybe Type)
- IdeSession: importAs :: Import -> SrictNotUnpacked(Maybe ModuleName)
- IdeSession: importEntities :: Import -> SrictNotUnpackedImportEntities
- IdeSession: importImplicit :: Import -> SrictNotUnpackedBool
- IdeSession: importModule :: Import -> SrictNotUnpackedModuleId
- IdeSession: importPackage :: Import -> SrictNotUnpacked(Maybe Text)
- IdeSession: importQualified :: Import -> SrictNotUnpackedBool
- IdeSession: interrupt :: RunActions a -> IO ()
- IdeSession: liCabalsDir :: LicenseArgs -> FilePath
- IdeSession: liDistDir :: LicenseArgs -> FilePath
- IdeSession: liExtraPathDirs :: LicenseArgs -> [FilePath]
- IdeSession: liLicenseExc :: LicenseArgs -> [String]
- IdeSession: liPackageDBStack :: LicenseArgs -> PackageDBStack
- IdeSession: liPkgs :: LicenseArgs -> [PackageId]
- IdeSession: liStderrLog :: LicenseArgs -> FilePath
- IdeSession: liStdoutLog :: LicenseArgs -> FilePath
- IdeSession: licenseFixed :: LicenseArgs -> [(String, (Maybe License, Maybe FilePath, Maybe String))]
- IdeSession: moduleName :: ModuleId -> SrictNotUnpackedModuleName
- IdeSession: modulePackage :: ModuleId -> UnpkPackageId
- IdeSession: packageKey :: PackageId -> SrictNotUnpackedText
- IdeSession: packageName :: PackageId -> SrictNotUnpackedText
- IdeSession: packageVersion :: PackageId -> SrictNotUnpacked(Maybe Text)
- IdeSession: progressNumSteps :: Progress -> Int
- IdeSession: progressOrigMsg :: Progress -> Maybe Text
- IdeSession: progressParsedMsg :: Progress -> Maybe Text
- IdeSession: progressStep :: Progress -> Int
- IdeSession: runBufferBlockSize :: RunBufferMode -> Maybe Int
- IdeSession: runBufferTimeout :: RunBufferMode -> Maybe Int
- IdeSession: runWait :: RunActions a -> IO (Either ByteString a)
- IdeSession: sessionInitCabalMacros :: SessionInitParams -> Maybe ByteString
- IdeSession: sessionInitGhcOptions :: SessionInitParams -> [String]
- IdeSession: sessionInitRelativeIncludes :: SessionInitParams -> [FilePath]
- IdeSession: sessionInitRtsOpts :: SessionInitParams -> [String]
- IdeSession: sessionInitTargets :: SessionInitParams -> Targets
- IdeSession: sourceFiles :: ManagedFiles -> [FilePath]
- IdeSession: spanFilePath :: SourceSpan -> SrictNotUnpackedFilePath
- IdeSession: spanFromColumn :: SourceSpan -> UnpkInt
- IdeSession: spanFromLine :: SourceSpan -> UnpkInt
- IdeSession: spanToColumn :: SourceSpan -> UnpkInt
- IdeSession: spanToLine :: SourceSpan -> UnpkInt
- IdeSession: supplyStdin :: RunActions a -> ByteString -> IO ()
+ IdeSession: [Binder] :: IdScope
+ IdeSession: [BreakInfo] :: ModuleName -> SourceSpan -> Type -> VariableEnv -> BreakInfo
+ IdeSession: [DataName] :: IdNameSpace
+ IdeSession: [ExternalException] :: String -> Maybe IOException -> ExternalException
+ IdeSession: [GHC_7_10] :: GhcVersion
+ IdeSession: [GHC_7_4] :: GhcVersion
+ IdeSession: [GHC_7_8] :: GhcVersion
+ IdeSession: [GlobalPackageDB] :: PackageDB
+ IdeSession: [IdInfo] :: UnpkIdProp -> SrictNotUnpackedIdScope -> IdInfo
+ IdeSession: [IdProp] :: SrictNotUnpackedName -> SrictNotUnpackedIdNameSpace -> SrictNotUnpacked(Maybe Type) -> UnpkModuleId -> SrictNotUnpackedEitherSpan -> SrictNotUnpacked(Maybe ModuleId) -> IdProp
+ IdeSession: [ImportAll] :: ImportEntities
+ IdeSession: [ImportHiding] :: SrictNotUnpacked[Text] -> ImportEntities
+ IdeSession: [ImportOnly] :: SrictNotUnpacked[Text] -> ImportEntities
+ IdeSession: [Import] :: SrictNotUnpackedModuleId -> SrictNotUnpacked(Maybe Text) -> SrictNotUnpackedBool -> SrictNotUnpackedBool -> SrictNotUnpacked(Maybe ModuleName) -> SrictNotUnpackedImportEntities -> Import
+ IdeSession: [Imported] :: UnpkModuleId -> SrictNotUnpackedEitherSpan -> SrictNotUnpackedText -> IdScope
+ IdeSession: [InvalidSessionStateQueries] :: InvalidSessionStateQueries
+ IdeSession: [KindError] :: SourceErrorKind
+ IdeSession: [KindServerDied] :: SourceErrorKind
+ IdeSession: [KindWarning] :: SourceErrorKind
+ IdeSession: [LicenseArgs] :: PackageDBStack -> [FilePath] -> [String] -> FilePath -> FilePath -> FilePath -> [(String, (Maybe License, Maybe FilePath, Maybe String))] -> FilePath -> [PackageId] -> LicenseArgs
+ IdeSession: [Local] :: IdScope
+ IdeSession: [ManagedFiles] :: [FilePath] -> [FilePath] -> ManagedFiles
+ IdeSession: [ModuleId] :: SrictNotUnpackedModuleName -> UnpkPackageId -> ModuleId
+ IdeSession: [PackageId] :: SrictNotUnpackedText -> SrictNotUnpacked(Maybe Text) -> SrictNotUnpackedText -> PackageId
+ IdeSession: [Progress] :: Int -> Int -> Maybe Text -> Maybe Text -> Progress
+ IdeSession: [ProperSpan] :: UnpkSourceSpan -> EitherSpan
+ IdeSession: [RunActions] :: IO (Either ByteString a) -> IO () -> (ByteString -> IO ()) -> IO () -> RunActions a
+ IdeSession: [RunBlockBuffering] :: Maybe Int -> Maybe Int -> RunBufferMode
+ IdeSession: [RunBreak] :: RunResult
+ IdeSession: [RunForceCancelled] :: RunResult
+ IdeSession: [RunGhcException] :: String -> RunResult
+ IdeSession: [RunLineBuffering] :: Maybe Int -> RunBufferMode
+ IdeSession: [RunNoBuffering] :: RunBufferMode
+ IdeSession: [RunOk] :: RunResult
+ IdeSession: [RunProgException] :: String -> RunResult
+ IdeSession: [SessionConfig] :: FilePath -> [FilePath] -> InProcess -> Bool -> PackageDBStack -> [String] -> [(String, (Maybe License, Maybe FilePath, Maybe String))] -> (String -> IO ()) -> Bool -> SessionConfig
+ IdeSession: [SessionInitParams] :: Maybe ByteString -> [String] -> [FilePath] -> Targets -> [String] -> SessionInitParams
+ IdeSession: [SourceError] :: SrictNotUnpackedSourceErrorKind -> SrictNotUnpackedEitherSpan -> SrictNotUnpackedText -> SourceError
+ IdeSession: [SourceSpan] :: SrictNotUnpackedFilePath -> UnpkInt -> UnpkInt -> UnpkInt -> UnpkInt -> SourceSpan
+ IdeSession: [SpanId] :: IdInfo -> SpanInfo
+ IdeSession: [SpanQQ] :: IdInfo -> SpanInfo
+ IdeSession: [SpecificPackageDB] :: FilePath -> PackageDB
+ IdeSession: [TargetsExclude] :: [FilePath] -> Targets
+ IdeSession: [TargetsInclude] :: [FilePath] -> Targets
+ IdeSession: [TcClsName] :: IdNameSpace
+ IdeSession: [TextSpan] :: SrictNotUnpackedText -> EitherSpan
+ IdeSession: [TvName] :: IdNameSpace
+ IdeSession: [UserPackageDB] :: PackageDB
+ IdeSession: [VarName] :: IdNameSpace
+ IdeSession: [WiredIn] :: IdScope
+ IdeSession: [breakInfoModule] :: BreakInfo -> ModuleName
+ IdeSession: [breakInfoResultType] :: BreakInfo -> Type
+ IdeSession: [breakInfoSpan] :: BreakInfo -> SourceSpan
+ IdeSession: [breakInfoVariableEnv] :: BreakInfo -> VariableEnv
+ IdeSession: [configDeleteTempFiles] :: SessionConfig -> Bool
+ IdeSession: [configDir] :: SessionConfig -> FilePath
+ IdeSession: [configExtraPathDirs] :: SessionConfig -> [FilePath]
+ IdeSession: [configGenerateModInfo] :: SessionConfig -> Bool
+ IdeSession: [configInProcess] :: SessionConfig -> InProcess
+ IdeSession: [configLicenseExc] :: SessionConfig -> [String]
+ IdeSession: [configLicenseFixed] :: SessionConfig -> [(String, (Maybe License, Maybe FilePath, Maybe String))]
+ IdeSession: [configLog] :: SessionConfig -> String -> IO ()
+ IdeSession: [configPackageDBStack] :: SessionConfig -> PackageDBStack
+ IdeSession: [dataFiles] :: ManagedFiles -> [FilePath]
+ IdeSession: [errorKind] :: SourceError -> SrictNotUnpackedSourceErrorKind
+ IdeSession: [errorMsg] :: SourceError -> SrictNotUnpackedText
+ IdeSession: [errorSpan] :: SourceError -> SrictNotUnpackedEitherSpan
+ IdeSession: [externalException] :: ExternalException -> Maybe IOException
+ IdeSession: [externalStdErr] :: ExternalException -> String
+ IdeSession: [forceCancel] :: RunActions a -> IO ()
+ IdeSession: [idDefSpan] :: IdProp -> SrictNotUnpackedEitherSpan
+ IdeSession: [idDefinedIn] :: IdProp -> UnpkModuleId
+ IdeSession: [idHomeModule] :: IdProp -> SrictNotUnpacked(Maybe ModuleId)
+ IdeSession: [idImportQual] :: IdScope -> SrictNotUnpackedText
+ IdeSession: [idImportSpan] :: IdScope -> SrictNotUnpackedEitherSpan
+ IdeSession: [idImportedFrom] :: IdScope -> UnpkModuleId
+ IdeSession: [idName] :: IdProp -> SrictNotUnpackedName
+ IdeSession: [idProp] :: IdInfo -> UnpkIdProp
+ IdeSession: [idScope] :: IdInfo -> SrictNotUnpackedIdScope
+ IdeSession: [idSpace] :: IdProp -> SrictNotUnpackedIdNameSpace
+ IdeSession: [idType] :: IdProp -> SrictNotUnpacked(Maybe Type)
+ IdeSession: [importAs] :: Import -> SrictNotUnpacked(Maybe ModuleName)
+ IdeSession: [importEntities] :: Import -> SrictNotUnpackedImportEntities
+ IdeSession: [importImplicit] :: Import -> SrictNotUnpackedBool
+ IdeSession: [importModule] :: Import -> SrictNotUnpackedModuleId
+ IdeSession: [importPackage] :: Import -> SrictNotUnpacked(Maybe Text)
+ IdeSession: [importQualified] :: Import -> SrictNotUnpackedBool
+ IdeSession: [interrupt] :: RunActions a -> IO ()
+ IdeSession: [liCabalsDir] :: LicenseArgs -> FilePath
+ IdeSession: [liDistDir] :: LicenseArgs -> FilePath
+ IdeSession: [liExtraPathDirs] :: LicenseArgs -> [FilePath]
+ IdeSession: [liLicenseExc] :: LicenseArgs -> [String]
+ IdeSession: [liPackageDBStack] :: LicenseArgs -> PackageDBStack
+ IdeSession: [liPkgs] :: LicenseArgs -> [PackageId]
+ IdeSession: [liStderrLog] :: LicenseArgs -> FilePath
+ IdeSession: [liStdoutLog] :: LicenseArgs -> FilePath
+ IdeSession: [licenseFixed] :: LicenseArgs -> [(String, (Maybe License, Maybe FilePath, Maybe String))]
+ IdeSession: [moduleName] :: ModuleId -> SrictNotUnpackedModuleName
+ IdeSession: [modulePackage] :: ModuleId -> UnpkPackageId
+ IdeSession: [packageKey] :: PackageId -> SrictNotUnpackedText
+ IdeSession: [packageName] :: PackageId -> SrictNotUnpackedText
+ IdeSession: [packageVersion] :: PackageId -> SrictNotUnpacked(Maybe Text)
+ IdeSession: [progressNumSteps] :: Progress -> Int
+ IdeSession: [progressOrigMsg] :: Progress -> Maybe Text
+ IdeSession: [progressParsedMsg] :: Progress -> Maybe Text
+ IdeSession: [progressStep] :: Progress -> Int
+ IdeSession: [runBufferBlockSize] :: RunBufferMode -> Maybe Int
+ IdeSession: [runBufferTimeout] :: RunBufferMode -> Maybe Int
+ IdeSession: [runWait] :: RunActions a -> IO (Either ByteString a)
+ IdeSession: [sessionInitCabalMacros] :: SessionInitParams -> Maybe ByteString
+ IdeSession: [sessionInitGhcOptions] :: SessionInitParams -> [String]
+ IdeSession: [sessionInitRelativeIncludes] :: SessionInitParams -> [FilePath]
+ IdeSession: [sessionInitRtsOpts] :: SessionInitParams -> [String]
+ IdeSession: [sessionInitTargets] :: SessionInitParams -> Targets
+ IdeSession: [sourceFiles] :: ManagedFiles -> [FilePath]
+ IdeSession: [spanFilePath] :: SourceSpan -> SrictNotUnpackedFilePath
+ IdeSession: [spanFromColumn] :: SourceSpan -> UnpkInt
+ IdeSession: [spanFromLine] :: SourceSpan -> UnpkInt
+ IdeSession: [spanToColumn] :: SourceSpan -> UnpkInt
+ IdeSession: [spanToLine] :: SourceSpan -> UnpkInt
+ IdeSession: [supplyStdin] :: RunActions a -> ByteString -> IO ()
Files
- ChangeLog.md +3/−0
- README.md +61/−0
- ide-backend.cabal +2/−2
+ ChangeLog.md view
@@ -0,0 +1,3 @@+## 0.9.0.8++* Simple example in the README
README.md view
@@ -3,6 +3,67 @@ [](https://travis-ci.org/fpco/ide-backend) +In order to use this package, you must have the `ide-backend`, `ide-backend-server`, and `ide-backend-rts` packages installed.++Hello World+-----------++The following simple example demonstrates basic usage of ide-backend.++```haskell+{-# LANGUAGE OverloadedStrings #-}+import qualified Data.ByteString.Char8 as S8+import Data.Monoid ((<>))+import IdeSession++main :: IO ()+main = do+ -- Initialization and providing some code+ sess <- initSession defaultSessionInitParams defaultSessionConfig+ let upd = updateSourceFile "Main.hs" "main = putStrLn \"Hello World\""+ <> updateCodeGeneration True+ <> updateGhcOpts ["-Wall"]+ updateSession sess upd print -- print is used for progress updates++ -- Print errors and warnings+ errs <- getSourceErrors sess+ mapM_ print errs++ -- Run the code+ ra <- runStmt sess "Main" "main"+ let loop = do+ res <- runWait ra+ case res of+ Left bs -> S8.putStr bs >> loop+ Right rr -> putStrLn $ "Run result: " ++ show rr+ loop++ -- Get some type information+ expTypes <- getExpTypes sess+ print $ expTypes "Main" SourceSpan+ { spanFilePath = "Main.hs"+ , spanFromLine = 1+ , spanFromColumn = 8+ , spanToLine = 1+ , spanToColumn = 9+ }++ -- Autocompletion+ autoCompletion <- getAutocompletion sess+ print $ autoCompletion "Main" "putS"+```++Sample output for this run:++```+[1 of 1] Compiling Main+SourceError {errorKind = KindWarning, errorSpan = Main.hs@1:1-1:30, errorMsg = "Top-level binding with no type signature: main :: IO ()"}+Hello World+Run result: RunOk+[(Main.hs@1:8-1:16,"String -> IO ()"),(Main.hs@1:8-1:30,"IO ()")]+[putStr (VarName) defined in base-4.8.0.0:System.IO at <no location info> (home base-4.8.0.0:System.IO) (imported from base-4.8.0.0:Prelude at Main.hs@1:1-1:1),putStrLn (VarName) :: String -> IO () defined in base-4.8.0.0:System.IO at <no location info> (home base-4.8.0.0:System.IO) (imported from base-4.8.0.0:Prelude at Main.hs@1:1-1:1)]+```+ Versions and releases ---------------------
ide-backend.cabal view
@@ -1,5 +1,5 @@ name: ide-backend-version: 0.9.0.7+version: 0.9.0.8 synopsis: An IDE backend library description: See README.md for more details license: MIT@@ -11,7 +11,7 @@ category: Development build-type: Simple cabal-version: >=1.10-extra-source-files: README.md+extra-source-files: README.md ChangeLog.md library exposed-modules: IdeSession