-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Detect the repl type in cider-sync-request:info based on the current buffer #2560
Detect the repl type in cider-sync-request:info based on the current buffer #2560
Conversation
I've noticed that |
Probably the same also goes for |
I recall we discussed something like this with @kommen recently, but I'm fuzzy on the details and whether we actually decided on anything. I agree that picking some random connection is not the best way to go, and what you suggest seems reasonable.
Yeah, that's weird. In such cases nREPL will create some transient session for the duration of the request. |
This is the PR where we discussed this: #2467 I think we we came to the solution we have right now because of this comment:
|
Instead of having to figure this out for each request type, maybe having |
That seems somewhat reasonable. Keep in mind that relatively few ops have ClojureScript specific versions, so we should probably focus only on those. I'd aim to replicate whatever dispatch logic we're using for Also keep in mind that the terms clojure and clojurescript connection are a misnomer - all connections are actually the same, the "clojurescript" connections simply use an nREPL session where Piggieback is present. If you pass the right nREPL session to an operation it would work regardless of the connection used. The ClojureScript connection simply has as its session this piggieback nREPL session. Hopefully that's not super confusing. See also https://nrepl.org/nrepl/design/middleware.html#_sessions |
To summarize again - we need some more specific routing only for ops that have ClojureScript versions. Currently I think those are only "eval" (which should have it done right by now), "complete" and "info". |
Also - rebase on top of |
c7ce81a
to
24c9316
Compare
I've rebased on top of master and added another commit for the |
Thank you @ak-coram! |
cider-sync-request:info
is usingcider-nrepl-send-sync-request
without a connection argument, which leads to(cider-current-repl 'any)
being used to determine the current connection. This means that when M-. (cider-find-var
) is used in a cljs buffer it still sometimes tries to (unsuccessfully) find vars via the clj session of the project. I've added an explicit connection argument to thecider-nrepl-send-sync-request
call incider-sync-request:info
using(cider-current-repl)
(which determines the repl type based on the current buffer). This resolved the issue for me.Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
make test
)make lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.Thanks!
If you're just starting out to hack on CIDER you might find this section of its
manual extremely useful.