Skip to content
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

Test Plan Item: Python Native REPL #23484

Closed
3 tasks done
anthonykim1 opened this issue May 24, 2024 · 1 comment
Closed
3 tasks done

Test Plan Item: Python Native REPL #23484

anthonykim1 opened this issue May 24, 2024 · 1 comment
Labels
testplan-item Test plan item/assignments for upcoming release
Milestone

Comments

@anthonykim1
Copy link

anthonykim1 commented May 24, 2024

Refs: #23332 #23029

Complexity: 5

Create Issue


Thank you in advance for testing the newly implemented Python REPL.
Please let me know if you have any questions, problems, or comments.
I hope you find the experience itself quick and snappy.

Background Information

REPL Stands for Read-Evaluate-Print-Loop

From the REPL user study that was conducted, there were countless requests asking for Intellisense, syntax highlighting when using the Python REPL.

Those who were aware of the existing Jupyter extension's Interactive Window thought the additional installation (of Jupyter extension and iPykernel) came to be a considerable burden just to access REPL environment with access to Intellisense, and syntax highlighting which became pretty necessary baseline requirement in software programming.
There were also considerable number of users who were not even aware of the existence of Interactive Window hence visibility issue became pretty apparent.

Instead of defining, designing, and implementing a new editor type for the native REPL as the first thing out of the gate, it seemed more reasonable to first conduct a spike to find common ground between Python REPL and Jupyter's Interactive Window (After all, IW is a REPL as well) to give users a tangible product (in-house REPL) and gather further feedback towards more polished or Native REPL with brand new editor type which can be language agnostic.
Using the existing Notebook, Interactive API and commands gave a relatively trivial access to highly requested features listed above and left a room for further improvements to user's REPL workflow such as smart send and variable pane.

Newly implemented custom REPL also very much closely follows the workflow of the Python's original interactive interpreter (IDLE, REPL) in a way that Python extension will "smartly" execute on enter or shift enter(depending on the keybinding)
If the extension detects user is in multi-line mode (think of you have just typed if some_condition: and pressed enter to move to next line), we would wait for user to finish typing their Python command.
For complete and straight up 'wrong' single line text input, Python extension will go ahead and execute similar to how Python's original REPL handles it.

For the intended user experience at the moment, please go ahead and MAKE SURE to explicitly add "interactiveWindow.executeWithShiftEnter": false, into your settings.json

Setup:

  1. Install latest version of Python extension.
  2. Please add "interactiveWindow.executeWithShiftEnter": false, into your settings.json
  3. Also add "python.REPL.sendToNativeREPL": true, to your settings. Feel free to use the settings UI: Type repl and
    Screenshot 2024-05-24 at 3 01 37 PM toggle "on" to send Python commands to REPL.

Steps:

  1. Open Python file of your choice.
  2. Type in some Python command in your editor or have some pre-completed Python commands.
  3. Make sure to follow the setup steps to send Python commands to Native REPL which should open on the side of your currently active editor.
  4. Make sure you can access the native REPL via context menu: "right click" => "run python" => "Send selection/line to Python REPL" and also shift+enter keybinding.
  5. Type in some Python command in the newly opened Python REPL and press enter, or the play button to execute.
  6. Make sure you get intellisense in your 'input box'
  7. Feel free to continue to send commands from editor to the REPL via shift+enter
  8. Now toggle off the "Send to Native REPL" setting and make sure you can send commands to Terminal REPL.
  9. Make sure you can send to Terminal REPL via shift+enter and also see context menu for it when you "right click" => "run python" => "Send selection/line to Terminal"
  10. You should ONLY be seeing ONE of the two REPL or TERMINAL context menu depending on your "Send to Native REPL" setting.
  11. Play around in the REPL with your custom workflow.
@anthonykim1
Copy link
Author

I'm aware of the issue where each instance of shift+enter (send to native repl) is creating new REPL instance. It should be fixed with: #23496 PR merged.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
testplan-item Test plan item/assignments for upcoming release
Projects
None yet
Development

No branches or pull requests

5 participants