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
6767 , getNextSourceReferenceId
6868 , getSourcePathBySourceReferenceId
6969 , addSourcePathBySourceReferenceId
70+ -- * Internal use
71+ , send
72+ , sendRaw
7073 ) where
7174----------------------------------------------------------------------------
7275import Control.Concurrent ( ThreadId )
@@ -226,6 +229,16 @@ getAppStore = gets appStore
226229getCommand :: Adaptor app Command
227230getCommand = command <$> gets request
228231----------------------------------------------------------------------------
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+ ----------------------------------------------------------------------------
229242-- | Function for constructing a payload and writing bytes to a socket.
230243-- This function takes care of incrementing sequence numbers
231244-- and setting fields automatically that are required for 'response' messages.
You can’t perform that action at this time.
0 commit comments