packages feed

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

{-# LANGUAGE TemplateHaskell     #-}


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

import Data.Aeson.TH

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

-- |
--   Body for "stackTrace" request.
--
data StackTraceBody =
  StackTraceBody {
    stackFramesStackTraceBody :: [StackFrame]  -- The frames of the stackframe. If the array has length zero, there are no stackframes available. This means that there is no location information available. 
  , totalFramesStackTraceBody :: Int           -- The total number of frames available.
  } deriving (Show, Read, Eq)


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


-- |
--
defaultStackTraceBody :: StackTraceBody
defaultStackTraceBody = StackTraceBody [] 0