Fork me on GitHub
#cider
<
2020-07-09
>
drewverlee14:07:50

cider seems to be giving me type hint information about the method i'm calling on the java class. But can it give me the return type of the method?

drewverlee14:07:39

i guess if i eval it, this in the information outputted

drewverlee14:07:54

or i could call type on it

drewverlee14:07:43

i would think that calling cider-java-doc on the symbol would give me the java docs if calling type on it and manually entering the type would work, but that doesn't seem to work in all cases.

andrea.crotti14:07:21

is there a way to make sure that when switching to a repl buffer, it never replaces the buffer I'm currently on?

andrea.crotti14:07:09

I'm not sure I undestand the pattern of the behaviour but often even if there already another window available it still replaces the one I'm on, which is never what I want to do

dpsutton15:07:08

@andrea.crotti can you explain? not sure what you expect to happen. if you switch to a buffer, it replaces the buffer you are viewing. you can make a split and switch one of those buffers to the repl

andrea.crotti15:07:04

well sometimes when I switch to the repl buffer it doesn't replace the buffer I'm on

andrea.crotti15:07:21

would like to just enforce that behaviour somehow

dpsutton15:07:33

i'm not following what you mean by switch to repl buffer then

andrea.crotti15:07:59

just cider-switch-to-repl-buffer

dpsutton15:07:09

ahh, cider-switch-to-repl-buffer . i was thinking just colloqually of "switching to the repl buffer"

dpsutton15:07:17

sorry about that

dpsutton15:07:37

have you seen cider-repl-display-in-current-window?

dpsutton15:07:44

"Controls whether the REPL buffer is displayed in the current window."

andrea.crotti15:07:26

yeah, it's off though atm

andrea.crotti15:07:10

I can dig a bit deeper

andrea.crotti15:07:52

so maybe it should always display in a different widow but when for some reason it can't it will use the same window

jr0cket18:07:32

Is there a variable I can use to tell sesman-start which type of repl session I would like to start for a specific project? So instead of being prompted by a list of cider-jack-in-clj cider-jack-in-cljs ,,, CIDER uses a variable value in the project .dir-locals.el and starts the appropriate repl session for the project. I find sesman-start easier to use than remembering keybindnigs for each cicer-jack-in-* and cider-connect-* sessions, although in some projects is always going to be the same type of repl session. Thank you.

drewverlee19:07:59

My question might be smilar to what practicalli is asking about. At least in the same vein. I have a shadow-cljs project with a .dir-locals.el that contains

;; For Emacs users

;; simplifies commands need to start application via `cider-jack-in-cljs' by picking options here
;; rather then having to choose them at the command line.

;;; Directory Local Variables
;;; For more information see (info "(emacs) Directory Variables")

((clojurescript-mode
  ;; You use a shadow-cljs to build the project
  ;; This answers the question "which command should be used?"
  (cider-preferred-build-tool . shadow-cljs)
  ;; This sets a default repl type and  answers the question "select cljs repl type".
  (cider-default-cljs-repl . shadow)
  ;; This tells shadow cljs what to build and should match a key in your shadow-cljs.edn
  ;; build map. e.g :builds {:<some-key> {...}}
  ;; pramas passed to shadow-cljs to start nrepl via cider-jack-in
  (cider-shadow-default-options . ":app")))
Which put togehter some months back in order to simply my startup process. Now it seems running "cider-jack-in-cljs" and picking up that configuration isn't doing what i expect: 1. i get prompted for the command cli or shadow, when the .dir-local should take care of this. 2. upon selecting shadow-cljs it jsut seems to start the shadow server but not connect to it. Any ideas welcome. I'll try to dig into this on the weekend.

drewverlee19:07:56

could the fact the project is a submodule somehow be causing an issue?

bozhidar18:07:43

Are you running cider-jack-in while in a ClojureScript source buffer? If you aren't, those dir-locals won't get applied.

bozhidar18:07:08

The submodule shouldn't a problem, as long as you're running jack-in from a file within it.

drewverlee16:07:53

> Are you running cider-jack-in while in a ClojureScript source buffer? If you aren't, those dir-locals won't get applied. I believe i am. I'll try on a toy project so i can be more sure i understand the context though. Thanks for the reply.

drewverlee16:07:11

how do i check if i'm in a clojurescript source buffer?

drewverlee16:07:39

yea my buffer list says clojurescript

drewverlee16:07:18

maybe shadow cljs changed something? Now the dir locals setup in the shadow docs works https://shadow-cljs.github.io/docs/UsersGuide.html#_simplify_startup_with_dir_local I recall before it didnt.

neil.hansen.3122:07:57

Is there a way to get CIDER evaluation (like cider-eval-last-sexp) to play nicely with Clojurescript? I keep getting "No available JS runtime" message. I'm doing browser/Electron development with shadow-cljs. I realize that evaluation relies on the "browser runtime" and needs to be loaded through an index.html etc. But I'd like to know if there's anyway around this, it feels like I'm missing out on Clojure's best feature. Is everyone using Clojurescript just foregoing interactive evaluation in CIDER?

dpsutton22:07:09

there certainly is in CIDER. i'm not sure how to get that working with electron. with browser it should be straight forward. cider-jack-in-cljs and off you go

neil.hansen.3122:07:27

Hmm you're right that worked. This is great!

neil.hansen.3122:07:54

@dpsutton I think my issue was that I was using cider-connect-cljs and I was seeing this: (ignore the obvious +2 error, problem persists even with that corrected).

neil.hansen.3122:07:41

I wanted to use cider-connect-cljs because the error messages from shadow-cljs format much better in my Terminal than in the CIDER repl. If there was a way to redirect the CIDER output into a seperate, well-formatted buffer (the way cider-inspect does) I'd be a happy man.

neil.hansen.3122:07:06

Is this a known limitation of cider-connect-cljs? I really thought it would be functionally the same as cider-jack-in-cljs, just with the actual "process" being "hosted" outside of Emacs.

neil.hansen.3122:07:49

cider-jack-in-cljs also only seemed to solve the problem with a browser project, not with an Electron project.

neil.hansen.3122:07:06

...and got it to work! Two things I found: 1. With Electron, there are two separate builds to think about for main process and the renderer process. I was selecting main on cider-jack-in-cljs, when I should have selected my renderer build. 2. I needed to actually "refresh" the Electron "page". It wouldn't work right away. I suppose this makes sense now that I'm thinking about it, but I don't have a great mental model of how all these ClojureScript servers and compilers are working, so I'm finding that I can't really anticipate these problems before they happen.

neil.hansen.3122:07:08

@dpsutton Thanks for putting me on the right track. I really wouldn't have consider cider-jack-in-cljs without your suggestion. I'd still love to know why cider-connect-cljs won't work, to help improve the aforementioned mental model.

dpsutton22:07:57

when you start up your own process and cider-connect to it, are you including the middleware that CIDER needs?

dpsutton22:07:15

the CIDER repl will print what command it is using if you want to see

neil.hansen.3123:07:26

I am getting a little message at the top... clj-refactor and refactor-nrepl are out of sync. Their versions are 2.5.0 and n/a, respectively.

neil.hansen.3123:07:46

...if that's my problem, color me very embarassed.

dpsutton23:07:05

that shouldn't be causing too many issues. I don't use refactor-nrepl though

neil.hansen.3123:07:19

I can live with this. Now I'm wondering my cider-inspect won't work... All is fine in my browser-based project, but in the electron one (with the above (+ 2 2) example) I'm getting Inspector error for: 2 in the *cider-inspect* pop-up window.

neil.hansen.3123:07:11

I know you said you don't know about the Electron workflow (starting to think I don't either...), and this has been enough to keep me going today, thank you!

dpsutton23:07:21

@neil.hansen.31 anytime!