mirror of
https://github.com/haskell/ghcide.git
synced 2024-12-16 22:52:41 +03:00
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.
This commit is contained in:
parent
30b531a51f
commit
b6fd3c1a75
@ -24,7 +24,6 @@ import Control.Monad.Except
|
|||||||
import Development.IDE.Types.Options (IdeOptions(..))
|
import Development.IDE.Types.Options (IdeOptions(..))
|
||||||
import Development.IDE.State.FileStore
|
import Development.IDE.State.FileStore
|
||||||
import qualified Development.IDE.Logger as Logger
|
import qualified Development.IDE.Logger as Logger
|
||||||
import Data.Maybe
|
|
||||||
import Data.Set (Set)
|
import Data.Set (Set)
|
||||||
import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
import Development.IDE.Functions.GHCError
|
import Development.IDE.Functions.GHCError
|
||||||
@ -70,14 +69,14 @@ unsafeClearDiagnostics = unsafeClearAllDiagnostics
|
|||||||
|
|
||||||
-- | Initialise the Compiler Service.
|
-- | Initialise the Compiler Service.
|
||||||
initialise :: Rules ()
|
initialise :: Rules ()
|
||||||
-> Maybe (Event -> IO ())
|
-> (Event -> IO ())
|
||||||
-> Logger.Handle
|
-> Logger.Handle
|
||||||
-> IdeOptions
|
-> IdeOptions
|
||||||
-> VFSHandle
|
-> VFSHandle
|
||||||
-> IO IdeState
|
-> IO IdeState
|
||||||
initialise mainRule toDiags logger options vfs =
|
initialise mainRule toDiags logger options vfs =
|
||||||
shakeOpen
|
shakeOpen
|
||||||
(fromMaybe (const $ pure ()) toDiags)
|
toDiags
|
||||||
logger
|
logger
|
||||||
(setProfiling options $
|
(setProfiling options $
|
||||||
shakeOptions { shakeThreads = optThreads options
|
shakeOptions { shakeThreads = optThreads options
|
||||||
|
@ -52,7 +52,4 @@ data Event
|
|||||||
| EventFileValidation Int Int
|
| EventFileValidation Int Int
|
||||||
-- ^ @EventFileValidation finishedValidations totalValidations @
|
-- ^ @EventFileValidation finishedValidations totalValidations @
|
||||||
-- How many validations have we finished of how many total.
|
-- How many validations have we finished of how many total.
|
||||||
| EventFatalError !T.Text
|
|
||||||
-- ^ @EventFatalError reason@: A fatal error occurred in the compiler and
|
|
||||||
-- the compiler cannot continue.
|
|
||||||
deriving Show
|
deriving Show
|
||||||
|
@ -42,7 +42,7 @@ main = do
|
|||||||
vfs <- makeVFSHandle
|
vfs <- makeVFSHandle
|
||||||
ide <- initialise
|
ide <- initialise
|
||||||
mainRule
|
mainRule
|
||||||
(Just $ showEvent lock)
|
(showEvent lock)
|
||||||
(makeOneHandle $ withLock lock . T.putStrLn)
|
(makeOneHandle $ withLock lock . T.putStrLn)
|
||||||
IdeOptions
|
IdeOptions
|
||||||
{optPreprocessor = (,) []
|
{optPreprocessor = (,) []
|
||||||
|
Loading…
Reference in New Issue
Block a user