elixir-lsp / vscode-elixir-ls

Elixir language support and debugger for VS Code, powered by ElixirLS.
https://marketplace.visualstudio.com/items?itemName=JakeBecker.elixir-ls
MIT License
537 stars 106 forks source link

Feature request: Send to REPL/Terminal #409

Open naxels opened 7 months ago

naxels commented 7 months ago

Is this the right repo?

This is specifically a request for VSCode

Description:

When working in VSCode with Python, Jupyter, F#, Clojure, I can hit a keyboard combo (usually CMD + Enter on Mac) and the code is either executed intelligently in a REPL/Notebook tab (like Clojure, Jupyter) or send to a REPL terminal (like Python, F#)

Currently I have a separate terminal tab in VSCode with iex -S mix and copy/paste the code to execute

Proposed solution:

I would love to have the keyboard combo send my highlighted code to a REPL/Terminal like Python, where if no REPL terminal is running, it will start one & execute, else it will send the highlighted code (or line if no highlight) to the REPL.

This enables rapid REPL driven development :)

Thank you for considering!

lukaszsamson commented 7 months ago

Nice idea. Please create a PR

naxels commented 7 months ago

Nice idea. Please create a PR

Unfortunately I don't know enough about VSCode extensions & TS to help out.

Looking at both Python and F#, it's a bit more involved than just opening a terminal and running a command: https://github.com/microsoft/vscode-python/blob/main/src/client/terminals/codeExecution/repl.ts https://github.com/ionide/ionide-vscode-fsharp/blob/main/src/Components/Fsi.fs

And for Clojure it also create an output window right in the editor: https://github.com/BetterThanTomorrow/calva/blob/published/src/nrepl/repl-start.ts