packages feed

phoityne-vscode-0.0.1.0: app/Phoityne/IO/GUI/VSCode/TH/StoppedEventJSON.hs

{-# LANGUAGE TemplateHaskell     #-}


module Phoityne.IO.GUI.VSCode.TH.StoppedEventJSON where

import Data.Aeson.TH

import Phoityne.Utility
import Phoityne.IO.GUI.VSCode.TH.StoppedEventBodyJSON

-- |
--   Event message for "stopped" event type.
--   The event indicates that the execution of the debuggee has stopped due to some condition.
--   This can be caused by a break point previously set, a stepping action has completed, by executing a debugger statement etc.
--
data StoppedEvent =
  StoppedEvent {
    seqStoppedEvent   :: Int     -- Sequence number
  , typeStoppedEvent  :: String  -- One of "request", "response", or "event"
  , eventStoppedEvent :: String  -- Type of event
  , bodyStoppedEvent  :: StoppedEventBody
  } deriving (Show, Read, Eq)

$(deriveJSON defaultOptions { fieldLabelModifier = rdrop (length "StoppedEvent") } ''StoppedEvent)

defaultStoppedEvent :: Int -> StoppedEvent
defaultStoppedEvent seq = StoppedEvent seq "event" "stopped" defaultStoppedEventBody