-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Improvements to “Execute Line in Console” feature in PyCharm. #711
base: master
Are you sure you want to change the base?
Conversation
I have attached a video clip above to help visualize the feature. |
29e3e78
to
4a721d4
Compare
43fa9b2
to
eae05a2
Compare
e42d4a1
to
267e685
Compare
4ed307d
to
935df01
Compare
328717b
to
23aa74f
Compare
bd60b56
to
074bbc0
Compare
8fa79f5
to
a97dbee
Compare
@Elizaveta239 is this PR ok? Let me know if I need to do more. |
Hi @guoci! Yes, the PR is ok, thank you! The feature looks interesting, but we still can't estimate its usefulness. |
@Elizaveta239 thanks! I will need some time to get that done. |
@Elizaveta239 where are the instructions for creating a PyCharm plugin? I can find one for creating a Intellij plugin https://www.jetbrains.org/intellij/sdk/docs/, but not for a PyCharm plugin. |
@guoci In fact all PyCharm plugins are Intellij IDEA plugins. So you should develop it as IDEA plugin, and mention in settings, that your plugin is compatible only with PyCharm, not with other Intellij-based IDEs. We even had a webinar about plugin development recently: https://blog.jetbrains.com/pycharm/2019/01/webinar-recording-live-development-of-a-pycharm-plugin-with-joachim-ansorg/ |
Now published as PyCharm plugin. |
Great news! Usually plugin approval takes a few days, I'll ask to make it faster. |
Hi @guoci. I just wanted to thank you for he creation of this plugin. For those of us who are learning Python after a background in R, this comes very very handy. Thanks! |
@carlosahumada89 Thanks. Me too, I tried to implement this feature to emulate RStudio's AFAIK, no Python IDE has this feature. |
Actually there is a relatively new pycharm plug-in that works perfectly. Not sure the name at the moment.
…Sent from my iPhone
On Aug 30, 2019, at 11:31 AM, guoci <[email protected]<mailto:[email protected]>> wrote:
@carlosahumada89<https://github.com/carlosahumada89> Thanks. Me too, I tried to implement this feature to emulate RStudio's Run Selected Line(s) Crtl+Enter feature. Since Python is not a curly-brace language, the implementation is more complicated.
AFAIK, no Python IDE has this feature.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#711?email_source=notifications&email_token=AH2CEGBO5IL6ZXD2VMJQ7TDQHE4MJA5CNFSM4EMIWYUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD5R7S6Y#issuecomment-526645627>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AH2CEGC5ILTKUW2U64O5B4LQHE4MJANCNFSM4EMIWYUA>.
|
@Jmarks199 yes, I am the author of that plugin, link below. The code is based on this PR. |
@guoci @Elizaveta239 @Traff Maybe it's time to merge it? I've just implemented pretty the same feature for R plugin. Looks like that's really useful for DataScience mode. |
@vedun-z Sure, but at the moment it requires some steps from one of the JetBrains team members. We need to:
Unfortunately, I'm currently busy with other tasks. @vedun-z You're welcome to do these steps. |
@Elizaveta239 Thank you for great opportunity, but as long as this feature are not going to 2019.3 anyway, there's no reason to rush. We could schedule it to 2020.1, what do you think? |
Sure! I've created a feature request for it: https://youtrack.jetbrains.com/issue/PY-38919 |
@vedun-z @Elizaveta239 it would be nice to get this going again. It's really surprising this hasn't been added as a feature. The real question is, why would anyone ever want to use the default execute in console functionality? Personally, I can't imagine using Pycharm without this feature and the plugin seems to be broken in version 2021.3. java.lang.NoSuchMethodError: 'void com.jetbrains.python.actions.PyExecuteSelectionAction.showConsoleAndExecuteCode(com.intellij.openapi.actionSystem.AnActionEvent, java.lang.String)' |
I have just uploaded an update, currently pending approval from JetBrains. |
For code to the plugin, see https://github.com/guoci/pycharm-smart-execute. |
@guoci thanks for fixing this! Working beautifully. Much appreciated. |
@guoci good job! thanks! |
08f2151
to
d1f830e
Compare
Hi PyCharm developers, |
This PR suggests some improvements to the “Execute Line in Console” feature in PyCharm. Currently, that feature submits a line to the Python console, even when the line is an incomplete input. A screencast demonstrating the new feature in this PR is shown below.
In this PR, the following changes are implemented:
When the cursor is on a line and that line is an incomplete input, submit a minimum amount of lines to produce a complete input.
After that, the cursor in the editor is advanced accordingly.
Because of my unfamiliarity with the source code, I have used some code that is clearly not acceptable. I would appreciate if the reviewers can help with improving the code.