Fork me on GitHub
#cider
<
2020-06-07
>
stardiviner02:06:56

I'm newbie using Luminus lein new luminus myshadow +cljs +shadow-cljs But I got problem to get a browser-repl code compltion like (js/alert ..) in Emacs CIDER. Does any one have a complete steps how to do this? This problem really troubled me a long time.

dpsutton02:06:58

You are wanting completion for things like js/document and js/alert?

dpsutton02:06:44

there's some experimental support for that but its quite fragile in my experience

dpsutton02:06:27

I've usually kept it turned off to be honest

stardiviner02:06:31

@dpsutton Usually how do you setup the CIDER connection to shadow-cljs? I'm now confused what's the simple and correct way, I check many differnet steps.

dpsutton02:06:09

i usually just do cider-jack-in-cljs

dpsutton02:06:24

and then choose the options. its probably better to start up shadow's server on the command line though

dpsutton02:06:14

shadow-cljs -d cider/cider-nrepl:0.25.1 server and then cider-connect-cljs choose shadow-select. then (shadow/nrepl-watch :app) and then (shadow/nrepl-select :app)

stardiviner02:06:39

New method learned, Hope get luck.

stardiviner02:06:08

After shadow-cljs -d ... server I use cider-connect-cljs command, In CIDER prompt, it seems did not detect the correct port. which port should I use?

stardiviner02:06:08

After shadow-cljs -d ... server I use cider-connect-cljs command, In CIDER prompt, it seems did not detect the correct port. which port should I use?

ro623:06:49

You can pin the Shadow-CLJS port via the {:nrepl {:port <PORT>}} config option. I'm not sure they set the .nrepl-port file like Lein does.

thheller07:06:39

shadow-cljs creates .shadow-cljs/nrepl.port

dpsutton03:06:21

i don't know

dpsutton03:06:25

it seems to work for me

dpsutton03:06:45

you can just type in the port and it should work though

dpsutton03:06:51

that's just a convenience i believe

stardiviner03:06:38

I choose the 7002 port from command-line, then (shadow/watch :app) then (shadow/nrepl-select :app) . All works fine. But browser code completion still not available. Should I choose :browser-repl target instead?

dpsutton03:06:50

No. Are you talking about completion of cljs vars or things like js/alert?

stardiviner03:06:37

Both, I want to get both code completions.

stardiviner03:06:51

Or just only one of them can be archived?

stardiviner03:06:11

I tried the :browser-repl after cider-connect-cljs and shadow-cljs, At first time, it does not get code completion, Now it works fine now.

stardiviner03:06:34

dpsutton, thanks for your help. Really solved my big problem.

David Pham07:06:54

@robert.mather.rmm If you are totally new to Emacs, I would recommend prelude Emacs also from Bugs (the creator of Cider). It is smoother and lighter than spacemacs. As for spacemacs, did you download the master or develop branch? Master is outdated last time I checked.

David Pham07:06:54

@robert.mather.rmm If you are totally new to Emacs, I would recommend prelude Emacs also from Bugs (the creator of Cider). It is smoother and lighter than spacemacs. As for spacemacs, did you download the master or develop branch? Master is outdated last time I checked.

ro623:06:05

Thanks. I did Spacemacs master. The #spacemacs folks suggested trying develop as well. I'm a Vim user, so Evil mode is helpful for me. I'm guessing prelude is normal Emacs keybinding?