on master help sign in
Remove use of `managed` for starting the scenario service (#1508)

Ironically `managed` didn't turn out to make our code more manageable and we ended up mostly using it in very isolated places only to then immediately convert it back to bracket-style functions using `with`. This PR also removes the use of `managed` from the GcpLogger which was the only other place where we are using it and it finally kills the rather silly logic that starting up the scenario service was tied to having an event logger.

commitb6fd3c1a75566501725d0d6c2607dcb098eaed13 authorMoritz Kiefer <moritz.kiefer@purelyfunctional.org> dateTue 4 Jun 2019, 17:17 (7 years ago) parent30b531a
3 files changed+3−7
src/Development/IDE/State/Service.hs+2−3 src/Development/IDE/Types/LSP.hs−3 test/Demo.hs+1−1
src/Development/IDE/State/Service.hs+2−3
@@ -24,7 +24,6 @@ import Control.Monad.Except
2424import Development.IDE.Types.Options (IdeOptions(..))
2525import Development.IDE.State.FileStore
2626import qualified Development.IDE.Logger as Logger
27−import Data.Maybe
2827import Data.Set (Set)
2928import qualified Data.Set as Set
3029import Development.IDE.Functions.GHCError
@@ -70,14 +69,14 @@ unsafeClearDiagnostics = unsafeClearAllDiagnostics
7069
7170-- | Initialise the Compiler Service.
7271initialise :: Rules ()
73− -> Maybe (Event -> IO ())
72+ -> (Event -> IO ())
7473 -> Logger.Handle
7574 -> IdeOptions
7675 -> VFSHandle
7776 -> IO IdeState
7877initialise mainRule toDiags logger options vfs =
7978 shakeOpen
80− (fromMaybe (const $ pure ()) toDiags)
79+ toDiags
8180 logger
8281 (setProfiling options $
8382 shakeOptions { shakeThreads = optThreads options
src/Development/IDE/Types/LSP.hs−3
@@ -52,7 +52,4 @@ data Event
5252 | EventFileValidation Int Int
5353 -- ^ @EventFileValidation finishedValidations totalValidations @
5454 -- How many validations have we finished of how many total.
55− | EventFatalError !T.Text
56− -- ^ @EventFatalError reason@: A fatal error occurred in the compiler and
57− -- the compiler cannot continue.
5855 deriving Show
test/Demo.hs+1−1
@@ -42,7 +42,7 @@ main = do
4242 vfs <- makeVFSHandle
4343 ide <- initialise
4444 mainRule
45− (Just $ showEvent lock)
45+ (showEvent lock)
4646 (makeOneHandle $ withLock lock . T.putStrLn)
4747 IdeOptions
4848 {optPreprocessor = (,) []