OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Vscode command to run selection in REPL and maintain focus in editor

  • Thread starter Thread starter zwep
  • Start date Start date
Z

zwep

Guest
It seemed like a simple feature but I am unable figure it out.

What I want:

Work in the editor Execute a selection of lines in the native REPL Maintain focus on the editor from which I selected the lines of code

What I have: python.execSelectionInTerminal: this sends commands to the terminal and it maintains focus on the editor. python.execInREPL: this sends commands to the REPL but loses focus on the editor

What I tried:

Code:
{
        "command": "runCommands",
        "key": "shift+enter",
        "when": "editorTextFocus",
         "args": {
            "commands": [
                "python.execInREPL",
                "workbench.action.focusActiveEditorGroup"
            ]
        }
    },

but to no avail, my own created command did not set the focus properly. Can someone point me in the right direction? And can someone tell me where I can find documentation on all these workbench.action... and python... commands that I can use? I find it difficult to find that.
<p>It seemed like a simple feature but I am unable figure it out.</p>
<p>What I want:</p>
<p>Work in the editor
Execute a selection of lines in the native REPL
Maintain focus on the editor from which I selected the lines of code</p>
<p>What I have:
python.execSelectionInTerminal: this sends commands to the terminal and it maintains focus on the editor.
python.execInREPL: this sends commands to the REPL but loses focus on the editor</p>
<p>What I tried:</p>
<pre><code>{
"command": "runCommands",
"key": "shift+enter",
"when": "editorTextFocus",
"args": {
"commands": [
"python.execInREPL",
"workbench.action.focusActiveEditorGroup"
]
}
},
</code></pre>
<p>but to no avail, my own created command did not set the focus properly. Can someone point me in the right direction? And can someone tell me where I can find documentation on all these workbench.action... and python... commands that I can use? I find it difficult to find that.</p>
 

Latest posts

I
Replies
0
Views
1
impact christian
I
Top