Allow a configurable REPL

Issue #23 wontfix
created an issue

Allow the REPL that the ng server creates to be dynamically generated based on settings (possibly a Leiningen project file?).

Leiningen can execute:

{{{ lein repl }}}

to start a REPL with the required class paths for that project.

If that could somehow be utilized on a per project basis, it would increase the utility of the repl while testing large projects.

Comments (4)

  1. Meikel Brandmeyer repo owner

    At the moment the responsibility to start a correct nailgun environment is at the user. Vim cannot start programs in the background in a portable way. You'll have to start the nailgun server yourself. Before you enter the Vim session. If lein nail does what you want, then use it. Or start the repl with lein repl and fire off a nailgun server in a separate thread.

    Adding this automatically from Vim will add another fragile part which is hard to maintain and will only cut off more of my spare time for a non-issue.

    I'm sorry if this sounds harsh, but I really have no time at the moment for features which are very expensive in time for a very limited improvement. (This change only supports the laziness of the developer. Not a high incentive for such an expensive feature.)

  2. Meikel Brandmeyer repo owner

    Any contributions are appreciated. Also feedback and ideas are very welcome! :)

    Again for my decision on this specific topic: It is raised every other month that VimClojure should automatically start a nailgun server if none is running. This is...

    1. Very hard to implement, not only cross-platform but even on the same platform it might stop working because of unrelated settings.
    2. It requires VimClojure to know dependencies most likely in a cross-project manner.
    3. It just introduces more bookkeeping, because either VC has to understand maven poms or the developer has to note down the dependencies in several places in several formats.
    4. It may be hard to track down, why something fails if VC guesses the wrong dependencies leading to debug nightmares.

    Starting a nailgun server with the correct classpath is so easy: ant nailgun, gradle nailgun, lein nailgun, mvn nailgun... Ok maybe maven is not so easy. I dunno.

    I never had a single problem with the classpath, because I a) don't use hacks (read 'add-classpath') and b) I care for the classpath myself. I set up an explicit nailgun task in my build.gradle and never have to think about a missing dependency or a changed version, because gradle takes care of that.

    Vim is no IDE and will never be.

  3. brandonw reporter

    That's a very good point about the nailgun tasks in your build tool. I was thinking of it from the perspective of having the ng server be a script that is launched on startup of your OS, but your way is much better, because it gives you explicit control over the whole operation.

    Thanks for the tip :)

  4. Log in to comment