LightTable / Clojure

Light Table Clojure language plugin
MIT License
99 stars 51 forks source link

Commands needs to be set for client connection selection. #74

Closed rundis closed 8 years ago

rundis commented 8 years ago

This paritally reverts 65ebb33f3940940b120e98754a2c8a5570d120c2

LT creates a new connection for each namespace upon eval when using clojure >= 1.7 (which forces lein-light-nrepl 0.3.0 to be used).

Steps to reproduce: 1) In a project using clojure >= 1.7 2) Open a namespace and eval something -> Connection automatically added, but not that no commands are listed in the connect bar for the connection 3) Open another namespace and eval something there -> another connection is spawned 4) and so on...

The commands are added to the connection in https://github.com/LightTable/Clojure/blob/master/src/lt/plugins/clojure/nrepl.cljs#L122

When we later try to look up a connection like in eval, we pass a command which is used to locate an appropriate connection like in https://github.com/LightTable/Clojure/blob/master/src/lt/plugins/clojure.cljs#L185 . If this fails (which it does because no commands are stored in already created connections), a new connection is spawned by the try-connect function passed with the create key.

cldwalker commented 8 years ago

@rundis Thanks for fixing my mistake! Verified this works with a clojure 1.7 project e.g. lein new compojure hello-world. Feel free to merge and deploy. Instructions for releasing a plugin with lein-light-nrepl are at the bottom of this section. I usually keep the lein-light-nrepl and plugin versions in sync e.g. 0.3.2 for this release. You'll need to bump all references for the 0.3.1 plugin and all references for 0.3.0 of lein-light-nrepl especially this one. As for deploying to clojars I just do lein deploy clojars and turn off gpg checking in my ~/.lein/profiles.clj. If you can't get around to this before you go to bed, I'll deploy it later tonight. Thanks!