Fork me on GitHub
#cider
<
2018-08-10
>
stardiviner02:08:09

Sometimes my computer does not have Internet access, but I have package like openjdk8-doc installed, it is local Java Doc resource. Can CIDER doc open java doc link support to open this local resource (file:///usr/share/doc/java8-openjdk/...) ?

richiardiandrea02:08:09

@stardiviner I was on this piece of code today and I saw that the middleware uses clojure.java.javadoc under the hood, which iirc is configurable

richiardiandrea02:08:12

The orchard info namespace should contain more info, on the phone now. If you find it please let me know, I have been looking for that too 😄

richiardiandrea02:08:24

On mobile now 😉

stardiviner02:08:38

When I'm running CIDER debugger, Emacs is on high 95% CPU!! Is this normal?

stardiviner02:08:09

@richiardiandrea I found javadoc will invoke private function javadoc-url which decide use @*local-javadocs* or @*remote-javadocs*. In my CIDER debugging session, @*local-javadocs* is empty (). I found function add-local-javadoc used to add local javadoc, but I have not found it is used in namespace clojure.java.javadoc.

stardiviner02:08:32

Here is all the code of it. @richiardiandrea

richiardiandrea02:08:36

You probably need to call it before first usage or around the call to it...meaning that maybe it needs to be part of the middleware?

richiardiandrea02:08:02

Haven't seen that in a while

richiardiandrea02:08:01

If you have a user.clj you could try to set! but I do not think it will work

richiardiandrea02:08:35

Actually you could try calling add-local-javadoc

richiardiandrea02:08:08

From user.clj or something...if you use lein you can inject that call

richiardiandrea02:08:50

You know @stardiviner it a actually seem that orchard does its own custom thing: see bottom of https://github.com/clojure-emacs/orchard/blob/master/src/orchard/info.clj

richiardiandrea02:08:48

Looking in the resources first, then only looking for remote

richiardiandrea02:08:06

I would open a feature request of some sort 😄

stardiviner02:08:09

I'm trying to invoke the function with path (add-local-javadoc "/usr/share/doc/java8-openjdk/"), it is very slow. still waiting.

stardiviner02:08:48

After I execute upper sexp, it does have local javadoc, except this path exists but does not math in javadoc-url function. I should use specific sub-directory upper path.

stardiviner02:08:20

Now it works with (add-local-javadoc "/usr/share/doc/java8-openjdk/api/").

stardiviner02:08:55

I think this should be automatically detected on system. auto added for available. WDYT?

richiardiandrea02:08:43

I think it should be documented for sure simple_smile

richiardiandrea02:08:31

Cider could try standard locations for Linux and win maybe yeah + optoonally read from a defcustom

stardiviner03:08:36

Yes, me too. Will you add this feature request issue on GitHub?

stardiviner03:08:53

I don't know CIDER uses orchard (still using it now?), should this added to clojure.java.javadoc or orchard, CIDER ?

richiardiandrea03:08:42

@stardiviner can put a reminder, probably cider is fine

stardiviner04:08:53

Hmm, I will add an issue right now.

bozhidar06:08:20

> I don’t know CIDER uses orchard (still using it now?), should this added to clojure.java.javadoc or orchard, CIDER ?

bozhidar06:08:13

@stardiviner Sure it does. 🙂 Orchard is a pretty new thing - it was extracted from cider-nrepl just a few months ago to separate cleanly the middleware from the non-middleware part of the functionality.

bozhidar06:08:40

Reporting this in CIDER is fine, as it has to expose some interface to configure this anyways.

dominicm06:08:45

it's worth finding out if it's possible to automatically discover that directory by some means.

dominicm06:08:12

I can't see anything in the package I have that looks like it might help, such as a bin.

stardiviner06:08:26

Might check out whether that directory contains specific structure, like some files?

dominicm06:08:02

yep, the problem is, as always, NixOS and other Linux OS which place that directory elsewhere.

dominicm06:08:30

if the docs went into $JAVA_HOME, that would be much easier.

stardiviner08:08:42

@dominicm Hmm, I checked out $JAVA_HOME, it does not include doc. You're right, this makes it find doc automatically more complex in order to work on many platforms.

dominicm08:08:32

detection > configuration. Only about 5 people tend to change their configuration otherwise.

stardiviner08:08:19

Actually, we have realized that this will be complex for different platforms, just don't know how many different cases need to be considered. That's why keep an simpler solution use an Elisp defcustom, let CIDER to handle this variable path to do automatically initialize.

stardiviner08:08:07

I use Emacs do some configuration, this is necessary to change behavior or toggle somethings.

euccastro16:08:25

when I cider-jack-in-cljs in spacemacs develop I get the dependency cider/piggieback {:mvn/version "0.3.5"} injected into my -Sdeps. shouldn't it be 0.3.8? and how do I override that? I know it's defined in cider-jack-in-cljs-dependencies, but I tried overriding that in user-init, user-config and dotspacemacs-emacs-custom-settings and none took.

euccastro16:08:58

cider-jack-in-dependencies is likewise (("org.clojure/tools.nrepl" "0.2.13")) for some reason

bozhidar16:08:35

@euccastro Likely you haven’t updated CIDER in a while.

bozhidar16:08:53

The current snapshot certainly injects 0.3.8.

euccastro16:08:24

this is probably a lame question and more of a spacemacs one than a cider one, but how do I update my CIDER snapshot in spacemacs?

euccastro16:08:44

OK, I just wiped spacemacs and cloned it again and now I get 0.3.8 (and different errors, but I'll ask again later if I can't figure these out)

euccastro16:08:34

cider-jack-in-dependencies is still at (("org.clojure/tools.nrepl" "0.2.13")) though

bozhidar16:08:50

Yeah, I’ll change this before the final release. Had a very busy end of the week and I forgot about this.

bozhidar16:08:24

Generally this injection was there mostly because boot and lein tended to ship older versions of nREPL. Now the boot and the clj tasks run the latest version and switch to nREPL 0.4 won’t really affect lein repl or boot repl, so I was wonder how exactly to best approach this.

alexyakushev16:08:08

I've updated to the snapshot version of CIDER today and stumbled upon a behavior change. Previously, I was able to jump into the definition of a library which opened the file from the JAR. There, I could disable read-only mode and re-evaluate forms to my liking. Now, I get the error No linked CIDER sessions. I managed to work around this by calling sesman-link-to-buffer. Is this how I suppose to do it now, or is there a better way?

pauld16:08:10

@euccastro I had to put this: (setq sayid-inject-dependencies-at-jack-in nil) into my dotspacemacs/user-config section of my .spacemacs file to workaround a bug in sayid that gets injected if you are using the develop version of spacemacs.

euccastro16:08:15

@pauld thanks! yes, I had seen this and I have that in my dotspacemacs/user-config too

euccastro16:08:29

same for clj-refactor

pauld16:08:58

@euccastro Also to update all your packages in spacemacs I usually just hit enter while on the 'update packages' link an the spacemacs splash page.

pauld16:08:13

then you have to restart emacs

pauld16:08:23

I don't think the clj-refactor one is needed anymore - at least not for me

lilactown16:08:26

@alexyakushev I too have had issues with CIDER not being aware of linked REPLs. trying to put together a way to confidently reproduce it

bozhidar16:08:43

@alexyakushev That’s something we didn’t really consider initially - we wanted to map the connection sessions more tightly to a context, but we didn’t think that some people might want to eval stuff within a session outside the session context.

jumar17:08:26

I don't usually change library code but I tend to read such code often and in current state, it's not possible to even jump to definitions (besides "dumb jump") without associating buffer with connection explicitly

bozhidar16:08:17

Please, file a ticket for this so we can discuss it further, but in general this is a side-effect of the intended behaviour as document here.

bozhidar16:08:39

I think that a simple fix for this would be to propagate the context automatically in such situations, but Vitalie might suggest some alternatives.

euccastro16:08:07

OK, this is strange. after pulling latest spacemacs develop cider-jack-in-cljs-dependencies is correctly set to (("cider/piggieback" "0.3.8")) but I don't see that picked up in the startup line (`[nREPL] Starting server via /usr/local/bin/clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} refactor-nrepl {:mvn/version "2.4.0-SNAPSHOT"} cider/cider-nrepl {:mvn/version "0.18.0"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor", "cider.nrepl/cider-middleware"])'...`, and I get the following error after doing cider-jack-in-clojurescript and picking figwheel-main:

error in process filter: user-error: ClojureScript is not available.  See  for details
error in process filter: ClojureScript is not available.  See  for details

euccastro16:08:15

adding piggieback and clojurescript itself to my deps.edn doesn't seem to change anything

euccastro16:08:39

cider-version says CIDER 0.18.0snapshot (package: 20180808.1857)

pauld17:08:16

try making sure your dependencies are in the main deps section of the deps.edn file if they are not already. I had some issues when they were in :additional-deps or whatnot

alexyakushev17:08:31

@bozhidar Thanks, Bozhidar. I don't think my usecase deserves some thoughful explicit handling. But I will file a ticket in case it can be solved easily.

euccastro17:08:29

thanks @pauld! I had cleared -A:dev from my command line overrides. piggieback is still not auto-injected, but adding the dependency to my deps.edn works

bbrinck23:08:46

Is there a way to customize the REPL (or automatically start a custom sub-REPL) once CIDER connects via nrepl? I’d like to be able to adjust the way errors are handled (namely to use expound if the error is a spec error)

bbrinck23:08:53

I’d love a way to configure the REPL via some file so I can share my specific REPL configuration with others on my team