forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Prevent first Python command being lost #22902
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
72eb85c
prevent first command swallow
anthonykim1 8861db4
Add application shell
anthonykim1 e6dfa92
add application shell to djangoShellCodeExec
anthonykim1 3effe72
try increasing time to prevent timeout
anthonykim1 a56b7dd
Try to prevent with 1 second
anthonykim1 f71e75c
different timeout
anthonykim1 550b381
try get rid of timeout
anthonykim1 b8ccd0b
try switching order
anthonykim1 73cd561
add fallback for tests
anthonykim1 feca5ba
fixing test
anthonykim1 60a61d8
fixing test
anthonykim1 aa23d90
try if increasing time helps
anthonykim1 b9ae762
not using protected readonly
anthonykim1 3ed8991
check how original passes
anthonykim1 25a17bf
back to working state
anthonykim1 eb4e658
back to original timeout limit
anthonykim1 965476b
stop double calling sendCommand
anthonykim1 13b808c
remove duplicate repl
anthonykim1 caaeb4d
Update test to count for new Promise race
anthonykim1 41461eb
add comments
anthonykim1 45616dc
testing old test
anthonykim1 d508a98
adjust timeout
anthonykim1 0597446
testing
anthonykim1 e09f8ac
adjust timeout and comment
anthonykim1 61dcd8c
adjust timeout
anthonykim1 4596a95
switch promise
anthonykim1 ca79f34
try new test
anthonykim1 35d25fe
lint
anthonykim1 d2b2eda
add more test
anthonykim1 9e8ce00
try testing
anthonykim1 60f9448
update test
anthonykim1 38a2ea2
clean up
anthonykim1 160150d
more cleanup
anthonykim1 676e885
re-arrange
anthonykim1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
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.
Line 71 seems to do this already.
Generally, this code seems to be quite difficult to read (a for loop in an event listener in a promise that is returned by a promise), I suggest to reduce nesting a bit.
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.
Thank you for the feedback!! @hediet.
It's little tricky right now, since I wanted a promise that always returned true, maximum three second or faster if we see that Python REPL has launched before.
I definitely thought about removing the second timeout, but in testing scenario, I would get promise rejection since it could not read the ">>>" from TerminalData like how it would normally read from user's terminal when we launch Python REPL from shell of their choice.
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.
I don't understand why this would happen. Are you sure?
race
ignores future rejections.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.
Yeah, I found it pretty odd too.. Perhaps its because during testing, we don't have "mocking" of Terminal write data containing the ">>>" that I check for to see if Python REPL has launched?? hence maybe thats why it may be giving rejection before we pass with the 3 second condition.