avli / clojureVSCode

Clojure support for Visual Studio Code
https://avli.github.io/clojureVSCode/
MIT License
204 stars 34 forks source link

Find parent .nrepl-port file #131

Closed mrkam2 closed 3 years ago

mrkam2 commented 5 years ago

This PR enables the extension to auto-detect .nrepl-port file based on the active editor. This helps to quickly switch between nrepls when you have multiple projects in the same workspace.

avli commented 5 years ago

Hello @mrkam2,

Thank you for the PR!

I have tested your changes and there are a few things that should be resolved before I could accept them.

  1. Say, I have two Clojure projects with running nREPLs in my workspace and the clojureVSCode.autoStartNRepl option is set to false. Then I manually connect to a nREPL in the first project – everything works as expected. Now I switch to the second project and try to connect to its nREPL. I expect that I will be connected to the second project nREPL and the information about the nREPL will be updated in the status bar. Instead I get the "Already connected to nREPL. Disconnect first." warning message. So, technically, I cannot have two connections and switch them on-the-fly.
  2. Have you considered the case when we start the internal nREPL? Do you think it will be hard add the behavior when we have a separate internal nREPL for every project in a workspace? It would be extremely nice to have in order to provide consistend experience between the automatic and manual nREPL connection approaches.

Please let me know if I missed something. I like the way you move – this is a very important feature. Let's just polish it a bit before it goes to a release. Thanks again!