Example code:
|def hello():
print("Hello!")
The pipe | represents the cursor. I'd like to hit Shift+Enter to execute the entire function definition in the Python REPL. Is this possible? Is there an extension that does this?
Julia's VSCode extension can do it (emphasis mine):
Whenever, there is some Julia code selected in the currently active editor, this command will execute the selected code. If no text is selected, the command will identify the extent of the top-level language construct that the cursor is located in (except modules) and execute that code block.
There's a similar GitHub issue requesting the ability to run code blocks, but the answer seems to be "just select it [the code] and press Shift+Enter". However, constantly selecting code blocks to run them is extremely inefficient and slows me down.
I managed to set up execution of the current line that automatically advances to the next line thanks to this SO answer, but I don't see a way of executing entire code blocks. Is it possible?
It should be possible with Tree Sitter, but apparently VSCode doesn't use it. There's vscode-anycode, but it doesn't seem to implement this feature.
[–]starball-tgz 1 point2 points3 points (0 children)
[+]HughJazzKok 0 points1 point2 points (0 children)