Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calva should auto-connect to existing REPL instead of auto-jack-in #2632

Open
seancorfield opened this issue Sep 23, 2024 · 2 comments
Open

Comments

@seancorfield
Copy link
Contributor

When auto-connect and auto-jack-in options are enabled, and REPL connect sequences provided, if you jack-in to start a REPL and then reload the VS Code window, Calva should auto-connect after the reload, instead of trying to auto-jack-in.

In general, if auto-connect (and auto-jack-in) are enabled, and an existing .nrepl-port file is present, auto-connect should be attempted first (and for bonus points, only if that fails should it auto-jack-in).

See thread on Slack for background: https://clojurians.slack.com/archives/CBE668G4R/p1727118825831329

@PEZ
Copy link
Collaborator

PEZ commented Sep 23, 2024

Thanks for the report. We can't really make the jack-in repl survive a reload of the VS Code window. VS Code kills it because it's spawned by the VS Code window process.

However, if the repl is started in an integrated terminal, it will survive the reload. And then we can check for an existing repl before carrying out the auto-jack-in, and do auto-connect instead.

@seancorfield
Copy link
Contributor Author

FWIW, I've changed my workflow recently (again!) and instead of relying on (auto) jack-in, I now start a REPL manually (I have a repl script on my path that starts a combined REPL based on my dot-clojure stuff) and that survives reloads because VS Code just treats it as an existing terminal process. I've disabled auto jack-in but left auto connect in place, so after a reload Calva will connect back to the repl process running in the terminal. Works great and is less of an inconvenience than having the REPL restarted each time a reload occurs (auto jack-in).

TL;DR: this is very low priority for me now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants