Skip to content
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

WORK PROBABLY STILL NEEDED — Evaluate forms in multiple REPLs when appropriate #2766

Conversation

simon-katz
Copy link
Contributor

This addresses the issue of evaluating forms from .cljc files in both CLJ and CLJS REPLs — see #2756

There was already high-level code to handle multiple REPLs, but the low-level code (around Sesman sessions) didn't handle multiple REPLs.

I've made changes to cider-repls and cider-map-repls, adding some more optional parameters. I don't much like the way things have turned out, but I've tried to make sure that things are backward-compatible. Perhaps things should be done differently.

WORK IS PROBABLY STILL NEEDED TO COMPLETE THIS, but I'd appreciate comments before going further.

These are the outstanding issues that I'm aware of:

  • There are multiple evaluation results, from multiple REPLs. The result that happens second overwrites the result that happens first. I'm not sure what to do about this.
  • The manual needs updating. The new variable cider-eval-forms-in-all-sessions needs to be documented, and I think there may be some documentation that talks about evaluation happening in the most recent REPL, which will need to be fixed.
  • Perhaps new tests are needed. (I'm not sure I have the knowledge to do that — but I am happy to take a look if I get positive feedback on what I've done so far.)

Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):

  • The commits are consistent with our contribution guidelines
  • You've added tests (if possible) to cover your change(s)
  • All tests are passing (make test)
  • All code passes the linter (make lint) which is based on elisp-lint and includes
  • You've updated the changelog (if adding/changing user-visible functionality)
  • You've updated the user manual (if adding/changing user-visible functionality)

Thanks!

If you're just starting out to hack on CIDER you might find this section of its
manual
extremely useful.

@bbatsov
Copy link
Member

bbatsov commented Dec 3, 2019

What are you referring to as "all-sessions" in the PR? Evaluating code across multiple CIDER sessions or nREPL sessions doesn't make sense, so I'm assuming you're actually referring to all REPLs within one CIDER (sesman) session.

@simon-katz
Copy link
Contributor Author

simon-katz commented Dec 3, 2019

I meant across multiple CIDER sessions, but I realise now that this probably doesn't make sense because different CIDER sessions could be for different projects.

This sprung from a question I asked on the the #cider Clojurians channel on Slack on 22nd November:

I have a CLJ REPL and a CLJS REPL. My sesman-browser shows something like the following:
CIDER Sessions:
1: my-apps/my-app:localhost:63615
linked-to: proj(xxxx/dev/my-apps/my-app/)
objects: cider-repl %s(clj)
2: my-apps/my-app:localhost:8778
linked-to: proj(xxxx/dev/my-apps/my-app/)
objects: cider-repl %s(cljs:shadow-select)
Is it possible to pass the same form to both REPLs with C-M-x etc?
(Perhaps I’ve set up my sessions wrongly.)

So I have two CIDER sessions, one for CLJ and one for CLJS, in the same project.

The CLJ session was set up with a cider-jack-in and the CLJS session was set up with cider-connect-cljs to a server that was set up with shadow-cljs.

I was hoping for a way of evaluating a form in a .cljc file in both REPLs. Is there a way to do that?

@stale
Copy link

stale bot commented Mar 2, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

@stale stale bot added the stale label Mar 2, 2020
@stale
Copy link

stale bot commented Apr 1, 2020

This issues been automatically closed due to lack of activity. Feel free to re-open it if you ever come back to it.

@stale stale bot closed this Apr 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants