You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Run Selection/Line in Python Terminal" should automatically select the surrounding block of code #17209
Say my cursor is on the line that contains .conf(), with no text highlighted. If I hit Shift + Enter (python.execSelectionInTerminal), then only the .conf() line will be sent to the terminal, and it will fail with a syntax error.
What I want is to run the complete block of code, starting with spark = and going all the way to the closing parenthesis. To do that today, I need to highlight all the lines myself.
It would be great if this extension automatically detected and ran the block of code surrounding the current cursor position, specifically in the case where no text is highlighted. That way I could place my cursor anywhere inside the above example block of code, hit Shift + Enter, and the entire block of code will be sent to the terminal. I don't need to explicitly highlight the lines myself.
Having this ability lends to a more Jupyter-like experience, without needing to define explicit cells or move to notebooks. And it makes it much easier and quicker to send multi-line units of code -- like the above example, or function definitions, or if blocks, etc. -- to the terminal.
It seems like the extension should have enough information to correctly detect the block of code surrounding the current cursor position. In fact, if you move your cursor somewhere inside the above block of code and repeatedly run "Expand Selection" (editor.action.smartSelect.expand) it will incrementally grow the selection until the whole block is selected. Perhaps the underlying machinery can be reused to implement this idea.
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 5 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
Thank you for submitting your feature request and everyone who considered it! Unfortunately this issue did not receive enough votes over the allotted time, and so we are closing the issue.
Activity
brettcannon commentedon Sep 1, 2021
Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 5 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.
brettcannon commentedon Nov 1, 2021
Thank you for submitting your feature request and everyone who considered it! Unfortunately this issue did not receive enough votes over the allotted time, and so we are closing the issue.