clojure-maven-plugin icon indicating copy to clipboard operation
clojure-maven-plugin copied to clipboard

nREPL support , missing edge case

Open danielsz opened this issue 6 years ago • 1 comments

In the current implementation of the nREPL support (ClojureNReplMojoj.java), I noticed that an edge case is missing. User in the list below refers to user of clojure-maven-plugin.

  • User doesn't specify custom handler nor custom middleware -> no problem, nREPL defaults end up being used
  • User specifies custom nREPL handler and no custom nREPL middleware -> no problem, user-specified nREPL handler gets merged with nREPL default middleware
  • User specifies custom nREPL middleware and no custom nREPL handler -> no problem, user-specified nREPL middleware gets merged with nREPL default handler
  • User specifies both custom nREPL handler and custom nREPL middleware -> this is a problem, only the custom nREPL handler is being merged, custom nREPL middleware is ignored.

This is not a use case that comes up frequently, and it's possible to work around it, but it might be a good idea to handle it anyway.

danielsz avatar Jun 02 '19 12:06 danielsz

Or, instead of handling the case, throw an error to indicate that either a custom nREPL handler can be used, or user-supplied middleware, but not both at the same time.

danielsz avatar Jun 02 '19 19:06 danielsz