Fork me on GitHub
#emacs
<
2020-11-15
>
anonimitoraf08:11:32

I'm on the native-comp branch and there's this issue with sayid: https://github.com/clojure-emacs/sayid/pull/59 Any ideas for workarounds?

Iulian10:11:54

Hi! I am using emacs with cider and lein. I can get the repl started, but I cannot get buffer sexp eval at point, and the buffer itself seems unaware that cider is running. I read the documentation and watched videos demonstrating the interactive use, but I still cannot solve the problem.

Louis Kottmann10:11:24

hello lulian, do you have cider/cider-nrepl in your project.clj? is the cider-mode activated in your current buffer?

Iulian10:11:09

No, adding it now. Do I have to write a version, or if I don't, it will get the latest?

Louis Kottmann10:11:55

you have to write a version I believe

Louis Kottmann10:11:06

[cider/cider-nrepl "0.25.4"]

Louis Kottmann10:11:39

mind you, it you should be added as lein plugin (i.e: in the :plugins key)

Iulian10:11:49

Ok, I added it as a plugin, and it builds the project and starts the repl

Iulian10:11:21

but if I turn on cider-mode it still says not connected

Louis Kottmann10:11:52

did you cider-jack-in-clj?

Iulian10:11:01

I cider-jack-in-cljs

Iulian10:11:08

Do I have to also run the clj part?

Louis Kottmann10:11:18

that, I don't know, I don't use clojurescript

Iulian10:11:41

I thought they are made to work the same

Louis Kottmann10:11:48

but once you did cider-jack-in-cljs you should be able to C-M-x a sexp and it would be evaluated in the CIDER REPL

Iulian10:11:50

alright, I will try clj

Louis Kottmann10:11:15

do you code in clojurescript or clojure?

Iulian10:11:00

clojurescript

Iulian10:11:41

But I may be able to solve the problem with clojurescript myself, if I manage to run clojure correctly

Louis Kottmann10:11:16

I know there are a couple of gotchas with cljs, but clj should work out of the box yes

Iulian10:11:55

The thing is, I do cider-jack-in-clj, it starts the repl correctly, but the buffer is still cider [not connected]

Louis Kottmann10:11:16

any interesting error in C-h e ?

Iulian10:11:48

No, just the usual "starting server, connecting to server"

Iulian10:11:55

[nREPL] Starting server via /usr/bin/lein update-in :dependencies conj \[nrepl\ \"0.8.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.4\"\] -- repl :headless :host localhost
You can run the command ‘cider-jack-in-clj’ with C-c M-j
[nREPL] Starting server via /usr/bin/lein update-in :dependencies conj \[nrepl\ \"0.8.2\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.25.4\"\] -- repl :headless :host localhost
[nREPL] server started on 36699
[nREPL] Establishing direct connection to localhost:36699 ...
[nREPL] Direct connection to localhost:36699 established
```

Louis Kottmann10:11:07

can you access your namespaces in the repl at all?

Louis Kottmann10:11:15

, ns in CIDER buffer

Iulian10:11:32

Yes, I switched it to cider-nrepl just now

Iulian10:11:35

to try out the command

Iulian10:11:43

cider.nrepl, sorry

Louis Kottmann10:11:20

well, it's working

Iulian10:11:00

I got it working in the buffer as well

Iulian10:11:22

Thank you!

Louis Kottmann10:11:27

here begins the fun

Iulian10:11:29

I will now debug the cljs one

practicalli-johnny20:11:57

The figwheel-main template is a useful way to create a new project that should work as is with cider-jack-in-cljs Here is an example https://practicalli.github.io/clojurescript/web-design-basics/clojurebridge-london-website/create-project.html

kimim00:11:53

that depends. When connecting to repl, cider will prompt several options. Choose the correct one, and remember also open a navigator to run the cljs code.

Iulian00:11:18

The main problem, that I still have not solve yet, is that when I choose the figwheel option, emacs opens the repl in a new buffer, but the original buffer remains in the cider [not connected] state

Iulian00:11:38

When I choose the browser option, it actually works and connects correctly

practicalli-johnny00:11:12

If figwheel-main fails, then the project is probably not configured to run figwheel-main build tool for Clojurescript

Iulian00:11:01

It fails with plain figwheel only in the sense that it does not connect the buffer to the repl. Everything else works. The browser renders the application.