tpope / vim-salve

salve.vim: static support for Leiningen and Boot
196 stars 14 forks source link

Opting out of classpath detection #18

Closed daveyarwood closed 5 years ago

daveyarwood commented 5 years ago

I use vim-salve solely for the feature where it auto-connects fireplace to the nREPL that I have running, which it is able to find because the nREPL spits its port into a .nrepl-port file in the current directory.

I prefer to start my REPLs manually, but I still find it really convenient that I don't need to do anything extra like go find the port of the REPL I started and then tell fireplace to connect to it. So that's really nice.

But lately, I've been finding the classpath detection (which can take several seconds or much longer, depending on the project) cumbersome, and I've been looking for a way to turn it off because I don't think I need it for my typical workflow.

What do you think about adding an option that would allow one to disable just the classpath detection part of vim-salve? Something like g:disable_classpath_detection or g:disable_classpath_retrieval?

I'd be happy to submit a PR if you're on-board with the idea.

tpope commented 5 years ago

It uses the class path to determine the location of your source code for navigation commands, etc. Disabling would require an alternate execution path with presumably hard coded defaults, which is not especially attractive.

daveyarwood commented 5 years ago

After looking at the source for a bit, I think I see your point. path() is called in a bunch of places, so it would get pretty complicated to conditionally not do that.

FWIW, I prefer to use ctags to navigate code, and I have ctags well-customized for Clojure so that they generally work pretty well. It isn't perfect, but I prefer this approach because it means I can navigate Clojure code without needing to start a REPL.

Maybe it would be better for me to create a fork of salve that only has the parts I use? I could call it diet-salve. :smile:

daveyarwood commented 5 years ago

I've created a fork of vim-salve, vim-diet-salve, which provides a small part of the functionality of vim-salve that doesn't rely on classpath detection or the projectionist features.

If you're reading this issue and your needs are similar to mine, give it a try! :slightly_smiling_face: