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

Be able to specify Smart Send to use IPython #15988

Open
anandijain opened this issue Mar 11, 2024 · 16 comments
Open

Be able to specify Smart Send to use IPython #15988

anandijain opened this issue Mar 11, 2024 · 16 comments
Assignees
Labels
feature-request Request for new features or functionality interactive-window Impacts interactive window

Comments

@anandijain
Copy link

It'd be nice if I could use IPython instead of vanilla python repl with smart send. other than that it is an amazing and crucial feature - Thanks!

@anandijain anandijain added the feature-request Request for new features or functionality label Mar 11, 2024
@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Mar 11, 2024
@anthonykim1
Copy link

Hello @anandijain Thank you for the feature request, and the compliment! Is there any reason that you favor IPython? We are in a process of investigating and thinking about VS Code native REPL experience here: microsoft/vscode-python#22674 and microsoft/vscode-python#23029 but would love more of your feedback on why you prefer IPython.

@anthonykim1 anthonykim1 removed the triage-needed Issue needs to be triaged label Mar 12, 2024
@github-actions github-actions bot added the info-needed Issue requires more information from poster label Mar 12, 2024
@wagnerlmichael
Copy link

I stumbled onto this thread and I think this would be a great addition if it ends up making sense. I may not be understanding correctly, but iPython has things like tab completion, history, etc. Perhaps these additional features are what @anandijain was referencing?

Copy link
Contributor

github-actions bot commented Jun 7, 2024

Hey @anthonykim1, this issue might need further attention.

@anandijain, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@LarryLegend33
Copy link

Hi @anthonykim1 we are alll using vscode in our group, coding jax. All of us use jupyter in our interactive sessions, and having smart send for jupyter would be a major benefit.

@anthonykim1
Copy link

Thank you all for the feedback!
With the experimental setting VS Code native REPL, you will be able to get features like Intellisense, syntax highlighting for running Python code. Please give this a try available in insiders. Let me know if the new REPL lacks in some features you are looking forward to in a REPL experience. Would love to have that on the action item to work on in the future.

To enable this feature: you may click on setting and type 'repl' or add:
"python.REPL.sendToNativeREPL": true,
to your settings.json.
For the best experience, please also add
"interactiveWindow.executeWithShiftEnter": false, to your settings.json. This will closely replicate how Python's interactive interpreter behaves and will smartly execute or wait for you to type "complete" Python code.

Also strongly agree with the smart send. Not exactly with IPython but we are working to get it working with the native REPL that just got shipped last month: microsoft/vscode-python#23521

@TraceBivens
Copy link

I just installed the newest update and was excited to try the native REPL + smart send and was immediately disappointed to discover that it doesn't work with my conda environments. For me at least, the ideal behavior would be for smart send to either send to my currently active terminal OR to detect the currently active environment in that terminal and then use that kernel.

@anthonykim1
Copy link

anthonykim1 commented Jul 13, 2024

@TraceBivens Hello! Thanks for trying out the native REPL along with smart send.

You are right that the ideal behavior should be us respecting your most recently activated environment as a dedicated kernel/engine for Python REPL. Does this behavior persist when you "Python: Clear cache and reload" on command palette?
Try exiting out the already existing REPL tab and see if launching a new one will pick the desired interpreter option for you. If problem persist, please feel free to file as a github issue in our repository so we can track it there.

@bnarum
Copy link

bnarum commented Jul 24, 2024

Hello @anandijain Thank you for the feature request, and the compliment! Is there any reason that you favor IPython? We are in a process of investigating and thinking about VS Code native REPL experience here: microsoft/vscode-python#22674 and microsoft/vscode-python#23029 but would love more of your feedback on why you prefer IPython.

For me, I found this issue because I was looking for the ability to view tabular data in “Data Wrangler”, variable inspection and viewing plots. These are supported in Jupyter but “Smart send” is much better than having to type out Jupyter cells explicitly.

These features are well implemented in the julia-vscode extension, so I would suggest looking at how the repl interaction is implemented there for some inspiration.

@hutch3232
Copy link

I came here looking to make this same request. I hadn't heard of the native REPL before seeing this thread. I'm using VS Code 1.92.0 and the native REPL is working great with smart send. I like that it doesn't require the Jupyter extension or the ipykernel package and all of its dependencies. It keeps my project setup/dependencies simple and minimal. Thanks for this addition!

I am seeing one quirk with it though: when I do shift+enter on a line/block of code, it sends it to the native REPL but then my cursor is automatically moved to the REPL's text input window. I would much prefer it to jump ahead to the next line of runnable (i.e., skip comments) code. Then I can spam shift+enter to progress through my script interactively.

@bnarum
Copy link

bnarum commented Aug 3, 2024

I am seeing one quirk with it though: when I do shift+enter on a line/block of code, it sends it to the native REPL but then my cursor is automatically moved to the REPL's text input window. I would much prefer it to jump ahead to the next line of runnable (i.e., skip comments) code. Then I can spam shift+enter to progress through my script interactively.

This has been requested already. Please give this feature request a thumb up: microsoft/vscode-python#23843

Copy link
Contributor

github-actions bot commented Sep 3, 2024

Hey @anthonykim1, this issue might need further attention.

@anandijain, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@anthonykim1
Copy link

I'm transferring this feature request to Jupyter extension.
I think smart send inside notebook cell can be great addition!
/cc @amunger @rebornix

@anthonykim1 anthonykim1 removed feature-request Request for new features or functionality info-needed Issue requires more information from poster labels Sep 3, 2024
@anthonykim1 anthonykim1 transferred this issue from microsoft/vscode-python Sep 3, 2024
@DonJayamanne DonJayamanne assigned rebornix and amunger and unassigned anthonykim1 Sep 5, 2024
@andredmoliveira
Copy link

andredmoliveira commented Sep 12, 2024

Hi @anthonykim1 ! I was looking for something similar and found this thread.
It would be great to have the exact same behaviour when shit + enter to terminal "python.REPL.enableREPLSmartSend": true applicable to both Jupyter interactive window"jupyter.interactiveWindow.textEditor.executeSelection": true or Python Native REPL"python.REPL.sendToNativeREPL": true

@anthonykim1
Copy link

Hello @andredmoliveira ! I'm super glad you are liking Smart Send feature :)

You should be able to use smart send with the native repl. Reference: microsoft/vscode-python#23521
I believe all you need to do is specify both smart send and native setting to be true. (Make sure you check both user and workspace setting so you don't unintentionally override your intended behavior)

Having upvotes on this issue/request would probably get us more support for smart send with "jupyter.interactiveWindow.textEditor.executeSelection": true though.

@SamuelAllain
Copy link

Thanks @anthonykim1 for your replies and work. The problem with the native REPL is that it lacks several features as of now. The most important for me are :

  • the runtime
  • the variable provider (though I see something is under way)
  • the Data Wrangler connection.
    For now, I'll stick to IPython because those features outweigh the benefit of Smart Send

@DonJayamanne DonJayamanne reopened this Dec 16, 2024
@DonJayamanne DonJayamanne added interactive-window Impacts interactive window feature-request Request for new features or functionality labels Dec 16, 2024
@vs-code-engineering vs-code-engineering bot added this to the Backlog Candidates milestone Dec 16, 2024
@taeshahn
Copy link

taeshahn commented Dec 21, 2024

upvote for this feature!

I think the smart selection feature itself is already awesome, and I don't believe it necessarily needs to be limited to the native REPL. It would be great if we could benefit from this feature across any interactive shell (e.g. native REPL, terminal REPL, or Interactive Window).

Additionally, having the option to choose whether or not to move the cursor after sending the smallest runnable code snippet to the kernel, or being able to configure different keyboard shortcuts — similar to how Shift+Enter and Cmd+Enter work in Jupyter — would be incredibly helpful!

By the way, I really appreciate @anthonykim1 and the team adding these amazing features!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality interactive-window Impacts interactive window
Projects
None yet
Development

No branches or pull requests