BreakIndex, SrcSpan, Resume, SingleStep )
import PprTyThing
import DynFlags
+
+#ifdef USE_READLINE
import Packages
import PackageConfig
import UniqFM
+#endif
+
import HscTypes ( implicitTyThings )
import Outputable hiding (printForUser)
import Module -- for ModuleEnv
import Data.IORef ( IORef, readIORef, writeIORef )
+#ifdef USE_READLINE
import System.Posix.Internals ( setNonBlockingFD )
+#endif
-----------------------------------------------------------------------------
completeNone :: String -> IO [String]
completeNone _w = return []
+completeMacro, completeIdentifier, completeModule,
+ completeHomeModule, completeSetOptions, completeFilename,
+ completeHomeModuleOrFile
+ :: String -> IO [String]
+
#ifdef USE_READLINE
completeWord :: String -> Int -> Int -> IO (Maybe (String, [String]))
completeWord w start end = do
| offset+length x >= start = (start-offset,take (end-offset) x)
| otherwise = selectWord xs
-
-completeCmd, completeMacro, completeIdentifier, completeModule,
- completeHomeModule, completeSetOptions, completeFilename,
- completeHomeModuleOrFile
- :: String -> IO [String]
-
+completeCmd :: String -> IO [String]
completeCmd w = do
cmds <- readIORef commands
return (filter (w `isPrefixOf`) (map (':':) (map cmdName cmds)))
where
pkg_db = pkgIdMap (pkgState dflags)
#else
-completeCmd = completeNone
completeMacro = completeNone
completeIdentifier = completeNone
completeModule = completeNone
completeSetOptions = completeNone
completeFilename = completeNone
completeHomeModuleOrFile=completeNone
-completeBkpt = completeNone
#endif
-- ---------------------------------------------------------------------------