-
Notifications
You must be signed in to change notification settings - Fork 2
runInTerminal support #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Exposes 'sendRunInTerminalReverseRequest' helper too.
@dmjio I'm using this change in the debugger successfully. Perhaps you'd like to review? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but wondering if we can reuse send
here.
writeToHandle address handle payload | ||
resetAdaptorStatePayload | ||
---------------------------------------------------------------------------- | ||
-- | Write reverse request to Handle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since reverse requests technically do inherit from ProtocolMesssage
, I think it might best if we set the seqNum
. It should be possible to define sendReverseRequest
in terms of send
, and then we'd get this for free.
sendReverseRequest
:: ReverseCommand
-> Adaptor app request ()
sendReverseRequest rcmd = send $ do
setField "type" MessageTypeRequest
setField "command" rcmd
It very well might be true that reverse requests are not subject to sequence numbers, but since it technically inherits ProtocolMesssage
it's "the right thing to do".
Then sendRunInTerminalReverseRequest
could be
sendRunInTerminalReverseRequest :: RunInTerminalRequestArguments -> Adaptor app request ()
sendRunInTerminalReverseRequest args = do
setField "arguments" args
sendReverseRequest ReverseCommandRunInTerminal
monad-control >= 1.0.3 && < 1.1, | ||
mtl >= 2.2.2 && < 2.4, | ||
network >= 3.1.2 && < 3.2, | ||
network >= 3.1.2 && < 3.3, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏼
name = show (typeRep (Proxy @ReverseCommand)) | ||
---------------------------------------------------------------------------- | ||
instance ToJSON ReverseCommand where | ||
toJSON cmd = genericToJSONWithModifier cmd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
point free 💅🏼 toJSON = genericToJSONWithModifier
Fixes #15