formulahendry / vscode-code-runner

Code Runner for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
MIT License
2.21k stars 298 forks source link

New feature: Send/Evaluate code in REPL terminal #99

Open petersladek opened 7 years ago

petersladek commented 7 years ago

Would be really great If one could send/evaluate selected lines of code in active REPL terminal window instead of using output window. I mean something like SublimeREPL package for Sublime Text does. You write code in a file with nice editor features (autocomplete etc) , select a piece of code, hit alt+enter, and the code is evaluated in REPL. I really love that experience, and I couldn't find any extension that does this in VS Code.

gaulinmp commented 6 years ago

One suggestion is to use AutoHotKey. Here's my script to get that working with Stata:

SetTitleMatchMode 1
active_id := WinGetID("A")

WinActivate "Stata"
WinWaitActive "Stata"
Send "do " A_Args[1] "{enter}"
Sleep 1000 

;WinActivate "ahk_id " active_id

Exit
lttr commented 4 years ago

You can run your interpreter in integrated terminal and use vscode action workbench.action.terminal.runSelectedText to execute current line or selected text inside it.

Or for javascript you can use one of these extensions.