Repository navigation
Check servers with what Calva, Conjure and vim-fireplace send - #6
Merged
Merged
Conversation
nREPL evaluates every form of a request, so when one of them throws, the
output and values of the ones after it come after the eval-error status:
(/ 1 0) (println "after") 2
gets err, then ex with eval-error, then out "after\n", values nil and 2,
and done. wire.error-terminal reported that as a failure, so nREPL
itself would fail it for any request like that. The clients the rule is
there for don't run into it, as REPLy sends one form per request.
Now the rule leaves alone requests whose code is several forms, each in
brackets, like the code clients evaluate when they connect. Code in
other languages can't be told apart into forms, so for it the rule
stays as it was.
Before it can evaluate anything, vim-fireplace (without cider-nrepl)
asks the server for its classpath:
(System/getProperty "path.separator")
(or (System/getProperty "fake.class.path")
(System/getProperty "java.class.path") "")
(System/getProperty "user.dir")
(require 'clojure.repl 'clojure.java.javadoc)
proof serve didn't know or and System/getProperty, so vim-fireplace
couldn't connect to it and its tests couldn't use it. Now the path
separator and the working directory are the real ones, the classpath is
src and other properties are nil, as Java has them when they aren't set.
CIDER was the only client with a profile, so a server could pass every check and still break the other popular clients. Each new profile started as a recording of the client against nREPL through proof proxy (Conjure and vim-fireplace driven by a headless Neovim, Calva by its own nREPL client code under node), and says what the client needs from each reply, with links to the code that needs it: - Calva evaluates *ns* without a session, clones a session and asks for describe, and it sends only the ops it finds there. It then evaluates its startup code, and before code from a source file, the file's ns form. - Conjure asks for describe and ls-sessions, clones a session when there are none and evaluates code of its own in it (one form to find out the kind of Clojure, then its preamble). Before code from a source buffer it evaluates an ns form for the buffer's namespace, and its print options are a dict even when they're empty. - vim-fireplace finds the classpath by evaluating Java interop without a session, and reads the first three values, which it tells apart by the ns that comes with each one (the new values step option). Then it clones a session, and asks for the value of the user's code to be streamed with an integer. vim-fireplace can't connect without Java interop, so its checks need a new java capability, which the profiles of nREPL and Babashka declare. The preset matrix test now runs each server with its own capabilities, so its columns have the same skips as the real ones. The fake server splits code into forms the way wire.error-terminal does, so vim-fireplace's classpath code gets four values. Every server in the matrix passes the checks that apply to it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Profiles for the other popular clients, each started from a recording of the client against nREPL. vim-fireplace finds the classpath with Java interop, so its checks need a new
javacapability; failing ClojureCLR, Basilisp or jank for it would say nothing about those servers. wire.error-terminal now leaves multi-form evals alone, as nREPL itself goes on after a form that throws, and Conjure's startup code was the first check traffic to run into that.