Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a shortcut in VSCode to execute current line or selection in debug REPL?

I am developing with Python and commonly running code in an integrated terminal with Shift + Enter. However, when debugging the process seems to be more complicated. I need to copy the code, move focus to debug REPL (Ctrl + Shift + Y), paste, run and move focus back to the editor. Is there any easier way to do this?

like image 893
Kotka Avatar asked Jan 16 '20 11:01

Kotka


1 Answers

If you use the vscode's integrated debugging you can set a shortcut for sending selection to debug Repl. I use this on my keybindings.json config file:

{
    "key": "shift+alt+d",
    "command": "editor.debug.action.selectionToRepl"
}

The difference from the "workbench.action.terminal.runSelectedText" command is that you actually have to select the line to send to the debug Repl, does not work for just putting the cursor on the line and hitting the shortcut.

like image 194
RBA Avatar answered Sep 30 '22 02:09

RBA