microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.65k stars 29.05k forks source link

"Debug: Evaluate in Debug Console" sends selected text, not full line when no selection (which "Terminal: Run Selected Text In Active Terminal" does) #153721

Closed zachsiegel-capsida closed 2 years ago

zachsiegel-capsida commented 2 years ago

I don't see why the "Debug: Evaluate in Debug Console" command can't be a parallel of the "Terminal: Run Selected Text In Active Terminal" command, which, when no text is selected, sends the full current line. This is how most evaluate-and-run environments work (Jupyter notebooks, RStudio, Matlab), and it would be great to have that feature during debugging.

As long as someone is updating this command, it would be great to add an arg called something like advance_line so that when you use the command to send a line of code, the editor also advances the current line (again, this is a UX element that Jupyter, RStudio, and Matlab are built around).

@luabud, thank you, I didn't know about that shortcut. It would also be nice if this functionality behaved more like sending a line to the interactive console, for example if you haven't selected anything and you run the shortcut it will anything automatically execute the whole current line. Multi-line evaluation also seems problematic (at least on my Mac), when I try to execute multiple lines it sends them to the console but then doesn't execute them, I still have to click down on the console and hit the Enter key.

Originally posted by @abielr in https://github.com/microsoft/vscode-python/issues/14494#issuecomment-737600387

zachsiegel-capsida commented 2 years ago

👍