{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module DAP.Event
(
sendBreakpointEvent
, sendCapabilitiesEvent
, sendContinuedEvent
, sendExitedEvent
, sendInitializedEvent
, sendInvalidatedEvent
, sendLoadedSourceEvent
, sendMemoryEvent
, sendModuleEvent
, sendOutputEvent
, sendProcessEvent
, sendProgressEndEvent
, sendProgressStartEvent
, sendProgressUpdateEvent
, sendStoppedEvent
, sendTerminatedEvent
, sendThreadEvent
, defaultContinuedEvent
, defaultExitedEvent
, defaultInvalidatedEvent
, defaultMemoryEvent
, defaultOutputEvent
, defaultProcessEvent
, defaultProgressEndEvent
, defaultProgressStartEvent
, defaultProgressUpdateEvent
, defaultStoppedEvent
, defaultTerminatedEvent
, defaultThreadEvent
) where
import DAP.Types
import DAP.Adaptor
sendBreakpointEvent :: BreakpointEvent -> Adaptor app ()
sendBreakpointEvent :: forall app. BreakpointEvent -> Adaptor app ()
sendBreakpointEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeBreakpoint forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
sendCapabilitiesEvent :: CapabilitiesEvent -> Adaptor app ()
sendCapabilitiesEvent :: forall app. CapabilitiesEvent -> Adaptor app ()
sendCapabilitiesEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeCapabilities forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
sendContinuedEvent :: ContinuedEvent -> Adaptor app ()
sendContinuedEvent :: forall app. ContinuedEvent -> Adaptor app ()
sendContinuedEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeContinued forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultContinuedEvent :: ContinuedEvent
defaultContinuedEvent :: ContinuedEvent
defaultContinuedEvent
= ContinuedEvent
{ continuedEventThreadId :: Int
continuedEventThreadId = Int
0
, continuedEventAllThreadsContinued :: Bool
continuedEventAllThreadsContinued = Bool
False
}
sendExitedEvent :: ExitedEvent -> Adaptor app ()
sendExitedEvent :: forall app. ExitedEvent -> Adaptor app ()
sendExitedEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeExited forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultExitedEvent :: ExitedEvent
defaultExitedEvent :: ExitedEvent
defaultExitedEvent
= ExitedEvent
{ exitedEventExitCode :: Int
exitedEventExitCode = Int
0
}
sendInitializedEvent :: Adaptor app ()
sendInitializedEvent :: forall app. Adaptor app ()
sendInitializedEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeInitialized (forall (f :: * -> *) a. Applicative f => a -> f a
pure ())
sendInvalidatedEvent :: InvalidatedEvent -> Adaptor app ()
sendInvalidatedEvent :: forall app. InvalidatedEvent -> Adaptor app ()
sendInvalidatedEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeInvalidated forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultInvalidatedEvent :: InvalidatedEvent
defaultInvalidatedEvent :: InvalidatedEvent
defaultInvalidatedEvent
= InvalidatedEvent
{ invalidatedEventAreas :: [InvalidatedAreas]
invalidatedEventAreas = []
, invalidatedEventThreadId :: Maybe Int
invalidatedEventThreadId = forall a. Maybe a
Nothing
, invalidatedEventStackFrameId :: Maybe Int
invalidatedEventStackFrameId = forall a. Maybe a
Nothing
}
sendLoadedSourceEvent :: LoadedSourceEvent -> Adaptor app ()
sendLoadedSourceEvent :: forall app. LoadedSourceEvent -> Adaptor app ()
sendLoadedSourceEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeLoadedSource forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
sendMemoryEvent :: MemoryEvent -> Adaptor app ()
sendMemoryEvent :: forall app. MemoryEvent -> Adaptor app ()
sendMemoryEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeMemory forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultMemoryEvent :: MemoryEvent
defaultMemoryEvent :: MemoryEvent
defaultMemoryEvent
= MemoryEvent
{ memoryEventMemoryReference :: Text
memoryEventMemoryReference = forall a. Monoid a => a
mempty
, memoryEventOffset :: Int
memoryEventOffset = Int
0
, memoryEventCount :: Int
memoryEventCount = Int
0
}
sendModuleEvent :: ModuleEvent -> Adaptor app ()
sendModuleEvent :: forall app. ModuleEvent -> Adaptor app ()
sendModuleEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeModule forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
sendOutputEvent :: OutputEvent -> Adaptor app ()
sendOutputEvent :: forall app. OutputEvent -> Adaptor app ()
sendOutputEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeOutput forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultOutputEvent :: OutputEvent
defaultOutputEvent :: OutputEvent
defaultOutputEvent
= OutputEvent
{ outputEventCategory :: Maybe OutputEventCategory
outputEventCategory = forall a. Maybe a
Nothing
, outputEventOutput :: Text
outputEventOutput = forall a. Monoid a => a
mempty
, outputEventGroup :: Maybe EventGroup
outputEventGroup = forall a. Maybe a
Nothing
, outputEventVariablesReference :: Maybe Int
outputEventVariablesReference = forall a. Maybe a
Nothing
, outputEventSource :: Maybe Source
outputEventSource = forall a. Maybe a
Nothing
, outputEventLine :: Maybe Int
outputEventLine = forall a. Maybe a
Nothing
, outputEventColumn :: Maybe Int
outputEventColumn = forall a. Maybe a
Nothing
, outputEventData :: Maybe Value
outputEventData = forall a. Maybe a
Nothing
}
sendProcessEvent :: ProcessEvent -> Adaptor app ()
sendProcessEvent :: forall app. ProcessEvent -> Adaptor app ()
sendProcessEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeProcess forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultProcessEvent :: ProcessEvent
defaultProcessEvent :: ProcessEvent
defaultProcessEvent
= ProcessEvent
{ processEventName :: Text
processEventName = forall a. Monoid a => a
mempty
, processEventSystemProcessId :: Maybe Int
processEventSystemProcessId = forall a. Maybe a
Nothing
, processEventIsLocalProcess :: Bool
processEventIsLocalProcess = Bool
True
, processEventStartMethod :: Maybe StartMethod
processEventStartMethod = forall a. Maybe a
Nothing
, processEventPointerSize :: Maybe Int
processEventPointerSize = forall a. Maybe a
Nothing
}
sendProgressEndEvent :: ProgressEndEvent -> Adaptor app ()
sendProgressEndEvent :: forall app. ProgressEndEvent -> Adaptor app ()
sendProgressEndEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeProgressEnd forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultProgressEndEvent :: ProgressEndEvent
defaultProgressEndEvent :: ProgressEndEvent
defaultProgressEndEvent
= ProgressEndEvent
{ progressEndEventProgressId :: Text
progressEndEventProgressId = forall a. Monoid a => a
mempty
, progressEndEventMessage :: Maybe Text
progressEndEventMessage = forall a. Maybe a
Nothing
}
sendProgressStartEvent :: ProgressStartEvent -> Adaptor app ()
sendProgressStartEvent :: forall app. ProgressStartEvent -> Adaptor app ()
sendProgressStartEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeProgressStart forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultProgressStartEvent :: ProgressStartEvent
defaultProgressStartEvent :: ProgressStartEvent
defaultProgressStartEvent
= ProgressStartEvent
{ progressStartEventProgressId :: Text
progressStartEventProgressId = forall a. Monoid a => a
mempty
, progressStartEventTitle :: Text
progressStartEventTitle = forall a. Monoid a => a
mempty
, progressStartEventRequestId :: Maybe Int
progressStartEventRequestId = forall a. Maybe a
Nothing
, progressStartEventCancellable :: Bool
progressStartEventCancellable = Bool
False
, progressStartEventMessage :: Maybe Text
progressStartEventMessage = forall a. Maybe a
Nothing
, progressStartEventPercentage :: Maybe Int
progressStartEventPercentage = forall a. Maybe a
Nothing
}
sendProgressUpdateEvent :: ProgressUpdateEvent -> Adaptor app ()
sendProgressUpdateEvent :: forall app. ProgressUpdateEvent -> Adaptor app ()
sendProgressUpdateEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeProgressUpdate forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultProgressUpdateEvent :: ProgressUpdateEvent
defaultProgressUpdateEvent :: ProgressUpdateEvent
defaultProgressUpdateEvent
= ProgressUpdateEvent
{ progressUpdateEventProgressId :: Text
progressUpdateEventProgressId = forall a. Monoid a => a
mempty
, progressUpdateEventMessage :: Maybe Text
progressUpdateEventMessage = forall a. Maybe a
Nothing
, progressUpdateEventPercentage :: Maybe Int
progressUpdateEventPercentage = forall a. Maybe a
Nothing
}
sendStoppedEvent :: StoppedEvent -> Adaptor app ()
sendStoppedEvent :: forall app. StoppedEvent -> Adaptor app ()
sendStoppedEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeStopped forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultStoppedEvent :: StoppedEvent
defaultStoppedEvent :: StoppedEvent
defaultStoppedEvent
= StoppedEvent
{ stoppedEventReason :: StoppedEventReason
stoppedEventReason = StoppedEventReason
StoppedEventReasonStep
, stoppedEventDescription :: Maybe Text
stoppedEventDescription = forall a. Maybe a
Nothing
, stoppedEventThreadId :: Maybe Int
stoppedEventThreadId = forall a. a -> Maybe a
Just Int
0
, stoppedEventPreserveFocusHint :: Bool
stoppedEventPreserveFocusHint = Bool
False
, stoppedEventText :: Maybe Text
stoppedEventText = forall a. Maybe a
Nothing
, stoppedEventAllThreadsStopped :: Bool
stoppedEventAllThreadsStopped = Bool
False
, stoppedEventHitBreakpointIds :: [Int]
stoppedEventHitBreakpointIds = []
}
sendTerminatedEvent :: TerminatedEvent -> Adaptor app ()
sendTerminatedEvent :: forall app. TerminatedEvent -> Adaptor app ()
sendTerminatedEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeTerminated forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultTerminatedEvent :: TerminatedEvent
defaultTerminatedEvent :: TerminatedEvent
defaultTerminatedEvent
= TerminatedEvent
{ terminatedEventRestart :: Bool
terminatedEventRestart = Bool
False
}
sendThreadEvent :: ThreadEvent -> Adaptor app ()
sendThreadEvent :: forall app. ThreadEvent -> Adaptor app ()
sendThreadEvent = forall app. EventType -> Adaptor app () -> Adaptor app ()
sendSuccesfulEvent EventType
EventTypeThread forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall value app. ToJSON value => value -> Adaptor app ()
setBody
defaultThreadEvent :: ThreadEvent
defaultThreadEvent :: ThreadEvent
defaultThreadEvent
= ThreadEvent
{ threadEventReason :: ThreadEventReason
threadEventReason = ThreadEventReason
ThreadEventReasonStarted
, threadEventThreadId :: Int
threadEventThreadId = Int
0
}