-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
PR: Add functionality run to and from current line to editor #16509
PR: Add functionality run to and from current line to editor #16509
Conversation
Hi @rhkarls thanks for your interest in adding new functionalities to Spyder! From my side seems like a good idea 👍 |
I think it's a good idea. |
Thanks a lot - I will work on getting this ready when I have time in between traveling. Would be great to get some feedback on keyboard shortcuts and naming in the UI at a later stage |
The mac tests seem to fail due to some conda env issues and using python 2.7 (?). Otherwise this is ready for the most part I think - see todo list on top, and would be nice with a review. |
@ccordoba12, could the failing mac tests be due to some changes we made regarding mamba and conda-forge? |
@rhkarls could you do a rebase on top of the latest |
…eature-run_to_from_line
Cheers @dalthviz ! Seems that the fast mac test froze though. Due to my mediocre git skills I managed to do a merge, but looks clean. To do a proper rebase as you suggested, what git commands should be issued? What I did now was
|
$ git rebase 5.x |
@rhkarls I think a merge is ok too so the rebase is not needed anymore. I will retrigger the action that was cancelled to check if that helps 👍 |
I recommend "Run to current line" and "Run from current line". And to be clear, the lines run should be [beginning, current line), and [current line, end], respectively. |
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 @rhkarls ! I left a suggestion regarding the comment in the test for the functionality and also I would suggest to change the icon used or not to use icons at all for this actions at least for now. I think that re-using the 'run_selection' icon could be a little bit confusing, but I'm not sure what other icon is suitable to represent this.
Also, just in case regarding the icons, what do you think @ccordoba12 ?
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 @rhkarls for your work here! This LGTM 👍🏼 but just in case what do you think @ccordoba12 ?
Thanks a lot for your contribution @rhkarls! I'll try to take a look at it soon. |
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.
This is a great addition! Thanks @rhkarls for your help to implement this and your patience to get it merged.
Description of Changes
This PR adds functionality to run all lines either above or below the current cursor position.
If there is interest from the Spyder team to have this functionality I'd be happy to continue to work on this PR (see suggested todo list below).
This feature is available in other IDEs, for example VS Code with interactive python and R-Studio.
Currently the implementation in this WIP PR is identical to VS Code and R-Studio as it sends all the lines above or below the cursor verbose to the editor. An alternative is also to silently execute the lines not to fill the console.
Todo list
Issue(s) Resolved
Fixes #16431
Affirmation
By submitting this Pull Request or typing my (user)name below,
I affirm the Developer Certificate of Origin
with respect to all commits and content included in this PR,
and understand I am releasing the same under Spyder's MIT (Expat) license.
I certify the above statement is true and correct: @rhkarls