@@ -36,7 +36,7 @@ import GHC.Paths
3636
3737main :: IO ()
3838main = do
39− (ghcOptions, map toNormalizedFilePath -> files) <- getCmdLine
39+ (ghcOptions, map toNormalizedFilePath -> files, isIde) <- getCmdLine
4040
4141 -- lock to avoid overlapping output on stdout
4242 lock <- newLock
@@ -52,8 +52,10 @@ main = do
5252 ,optShakeProfiling = Nothing -- Just "output.html"
5353 }
5454
55− if null files then
56− runLanguageServer logger $ \event vfs ->
55+ if isIde then do
56+ putStrLn "Starting IDE server"
57+ runLanguageServer logger $ \event vfs -> do
58+ putStrLn "Server started"
5759 initialise mainRule event logger options vfs
5860 else do
5961 vfs <- makeVFSHandle
@@ -92,16 +94,17 @@ newSession flags = runGhc (Just libdir) $ do
9294
9395
9496-- | Convert the command line into GHC options and files to load.
95−getCmdLine :: IO ([String], [FilePath])
97+getCmdLine :: IO ([String], [FilePath], Bool)
9698getCmdLine = do
9799 args <- getArgs
98− args <- return $ if null args then [".ghci"] else args
100+ let isIde = "--ide" `elem` args
101+ args <- return $ delete "--ide" $ if null args then [".ghci"] else args
99102 let (flags, files) = partition ("-" `isPrefixOf`) args
100103 let (ghci, hs) = partition ((==) ".ghci" . takeExtension) files
101104 (flags, files) <- both concat . unzip . ((flags,hs):) <$> mapM readGhci ghci
102105 when (null files) $
103106 fail "Expected some files to load, but didn't find any"
104− return (flags, files)
107+ return (flags, files, isIde)
105108
106109readGhci :: FilePath -> IO ([String], [FilePath])
107110readGhci file = do