This repository has been archived by the owner on Dec 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 47
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Christellah
requested review from
abmahdy,
adclements,
markAtMicrosoft and
smmatte
as code owners
August 13, 2019 17:35
markAtMicrosoft
suggested changes
Aug 13, 2019
…dded into users/t-chcido/debugger-communication
abmahdy
reviewed
Aug 14, 2019
markAtMicrosoft
approved these changes
Aug 14, 2019
abmahdy
reviewed
Aug 14, 2019
previousState = copy.deepcopy(state) | ||
time.sleep(TIME_DELAY) | ||
if debug_mode: | ||
debugger_communication_client.update_state(json.dumps(message)) |
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.
Do we not need to sleep in debug mode?
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.
We don't because sockets are efficient enough to handle a lot of messages (whereas the pipe of the process gets fulled), at least so far I didn't encounter any issue with the auto-write functionality
abmahdy
approved these changes
Aug 14, 2019
LukeSlev
reviewed
Aug 14, 2019
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.
It works ✔ one thing I noticed tho, we always run our code even if someone uses a different config... should fix that somewhere
src/adafruit_circuitplayground/debugger_communication_client.py
Outdated
Show resolved
Hide resolved
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description:
This PR is for adding a socket communication between our extension (TS server) and the Python process (client) when the user starts a debug session.
How it's done :
onDebugSessionStarted
inextension.ts
and we launch a socket serverCommunicationHandlerServer.ts
.debud_user_code.py
instead of the regularprocess_user_code.py
.debud_user_code.py
will start a Python clientCommununicationHandlerClient.py
and set our API'sinDebugMode
boolean to true.show()
method, we check if we're in debug mode, if yes we use socket communication, otherwise we use the old method with print statements.Note:
Remember: You need to
pip install python-socketio
andpip install requests
and then runnpm i
Type of change
Limitations:
Testing:
Checklist: