Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions dap/src/DAP/Adaptor.hs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ module DAP.Adaptor
, getNextSourceReferenceId
, getSourcePathBySourceReferenceId
, addSourcePathBySourceReferenceId
-- * Internal use
, send
, sendRaw
) where
----------------------------------------------------------------------------
import Control.Concurrent ( ThreadId )
Expand Down Expand Up @@ -226,6 +229,16 @@ getAppStore = gets appStore
getCommand :: Adaptor app Command
getCommand = command <$> gets request
----------------------------------------------------------------------------
-- | 'sendRaw' (internal use only)
-- Sends a raw JSON payload to the editor. No "seq", "type" or "command" fields are set.
-- The message is still encoded with the ProtocolMessage Header, byte count, and CRLF.
--
sendRaw :: ToJSON value => value -> Adaptor app ()
sendRaw value = do
handle <- getHandle
address <- getAddress
writeToHandle address handle value
----------------------------------------------------------------------------
-- | Function for constructing a payload and writing bytes to a socket.
-- This function takes care of incrementing sequence numbers
-- and setting fields automatically that are required for 'response' messages.
Expand Down