File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ module DAP.Adaptor
67
67
, getNextSourceReferenceId
68
68
, getSourcePathBySourceReferenceId
69
69
, addSourcePathBySourceReferenceId
70
+ -- * Internal use
71
+ , send
72
+ , sendRaw
70
73
) where
71
74
----------------------------------------------------------------------------
72
75
import Control.Concurrent ( ThreadId )
@@ -226,6 +229,16 @@ getAppStore = gets appStore
226
229
getCommand :: Adaptor app Command
227
230
getCommand = command <$> gets request
228
231
----------------------------------------------------------------------------
232
+ -- | 'sendRaw' (internal use only)
233
+ -- Sends a raw JSON payload to the editor. No "seq", "type" or "command" fields are set.
234
+ -- The message is still encoded with the ProtocolMessage Header, byte count, and CRLF.
235
+ --
236
+ sendRaw :: ToJSON value => value -> Adaptor app ()
237
+ sendRaw value = do
238
+ handle <- getHandle
239
+ address <- getAddress
240
+ writeToHandle address handle value
241
+ ----------------------------------------------------------------------------
229
242
-- | Function for constructing a payload and writing bytes to a socket.
230
243
-- This function takes care of incrementing sequence numbers
231
244
-- and setting fields automatically that are required for 'response' messages.
You can’t perform that action at this time.
0 commit comments