guoci / pycharm-smart-execute

PyCharm plugin to execute python code
https://plugins.jetbrains.com/plugin/11945-python-smart-execute
GNU General Public License v3.0
9 stars 1 forks source link

I tested and it works very well. You work my harder than Dataspell dev team 🤣🤣🤣 #2

Closed guoci closed 1 year ago

guoci commented 1 year ago
          I tested and it works very well. You work my harder than Dataspell dev team 🤣🤣🤣

Unexpectedly but very good, now the feature I told you yesterday; "But in Rstudio, you can put your cursor at anywhere in the block code, Rstudio can recognized they all connected by the "pipe" now work with .py file as well. As long as the block of code are connected either inside the parathesis, or under the def, you can put your cursor any where to run it

But there is one issue, see this picture below for more detail. There are 2 block codes in the cell, but the action can only capture and run the first one only

image

Btw, in Jupyter lab you have the feature "Run selected line or highlighted text", I requested this feature for DataSpell for so long but they slowly working on it. Do you know any possible to have it?

Originally posted by @ntluong95 in https://github.com/guoci/pycharm-smart-execute/issues/1#issuecomment-1555970957

guoci commented 1 year ago

@ntluong95 Starting a new issue for this. I don't understand you, what are the 2 block codes? Jupyter lab's "Run selected line or highlighted text" feature seems to be similar to this plugin's "Smart execute selection in console".

ntluong95 commented 1 year ago

See the below picture. Only the blue area were sent to the console. The red aera was not evaluated and run.

image

Jupyter lab's "Run selected line or highlighted text" feature seems to be similar to this plugin's "Smart execute selection in console" --> What I meant is run the selected line or highlighted text in jupyter notebook, which show the result right under the cell, not in the console

guoci commented 1 year ago

I will try to fix that. I get your second point. But that feature is closed-sourced, so you will need JetBrains help for that.

guoci commented 1 year ago

@ntluong95 fixed, https://github.com/guoci/pycharm-smart-execute/releases/tag/0.1.12

ntluong95 commented 1 year ago

Confirmed it fixed. But new error just came. I will create another issue

ntluong95 commented 1 year ago

I will try to fix that. I get your second point. But that feature is closed-sourced, so you will need JetBrains help for that.

This was a thread in YouTrack but seem overlooked: https://youtrack.jetbrains.com/issue/DS-3825/Implement-Run-selection-line-in-console-for-Jupyter-notebooks

Do you think that there is a way to make it as the addition of your extension?

guoci commented 1 year ago

I think this is already implemented in Smart execute code in console, * actions with 3 variants. Some do not have default keyboard shortcuts so you need to set it yourself.

ntluong95 commented 1 year ago

But it excute code in the console. I want to implement it in jupyter kernal as Python console and Jupyter notebook they don't share variables with each other. You can see the example in Google Colab:

image

I only select the first 2 lines and press Ctrl + Shift + Enter to print the result of it:

image
guoci commented 1 year ago

Got it. Until JetBrains releases the source code or documents the API, it is going to take too much effort to implement this.

ntluong95 commented 1 year ago

I dont think JetBrains team is seriously going to do it. It was request for several years