calva

mkarp 2025-03-10T12:19:37.822549Z

Hey folks! Is there a way to have multiple "autoSelectForConnect": true items in calva.replConnectSequences for different projectRootPaths in a monorepo? Here’s a workflow I’d like to achieve: • User goes into projects/a/src/core.clj, connects to REPL session 1, Calva automatically selects the sequence for projects/a • User goes into projects/b/src/core.clj, connects to REPL session 2, Calva automatically selects the sequence for projects/b • Would be also magical if Calva auto switched between REPL sessions 1 and 2 depending which is a file from projects/a or projects/b is currently in focus (I’ve edited my previous question a bit)

pez 2025-03-10T12:27:56.062359Z

I don’t think you can do that kind of auto-connect with the current configuration. The projectRootPath has almost the opposite purpose. 😃 But I think it makes perfect sense, and in case there are several autoSelectForConnect I think Calva could choose the closest project root, rather than the first connect sequence in the config without disrupting existing configs too much. Issue welcome!

pez 2025-03-10T12:30:18.114309Z

As for the auto-switching. That’s a different beast. I think #joyride could be used to achieve it. But if we get the auto-select thing fixed, the gain may be quite small, since you would only save a ctrl+alt+c ctrl+alt+c keystroke for connecting.

mkarp 2025-03-10T12:34:30.579519Z

Yes, auto switching is a nice bonus, but not necessary for sure

mkarp 2025-03-10T12:34:58.108759Z

The double ctrl+alt+c in the file of a current project would be more than enough 🙏

pez 2025-03-10T12:37:54.973809Z

Issues for both would be nice. I think the auto-switch may be somewhat of a compensation for Calva’s one-repl-per-vscode-window limitation.

👍 1
mkarp 2025-03-10T12:48:54.692109Z

I’ve added the following https://github.com/BetterThanTomorrow/calva/issues/2753

🙏 1
pez 2025-03-10T21:50:05.078439Z

I have a WIP version of Calva with this implemented now. Pick the VSIX up here: https://app.circleci.com/pipelines/github/BetterThanTomorrow/calva/8546/workflows/b2fcddaf-c872-4b14-a68f-6eff6763d355/jobs/47396/artifacts Would be nice if more people gave it a spin too to get a bit more coverage on different project setups.