Fork me on GitHub
#cider
<
2015-06-30
>
andrea.crotti10:06:38

sometimes I have issues with cider in some projects, when cider fires up correctly

andrea.crotti10:06:43

but if I try a cider-refresh I gert

andrea.crotti10:06:20

something to do with the order things are loaded I suppose, but am I doing something wrong in general or that should work?

andrea.crotti10:06:10

I'm using the last version CIDER 0.10.0snapshot (package: 20150629.2315)

andrea.crotti10:06:43

however it's maybe related with https://github.com/clojure-emacs/cider/issues/950? what would be a workaround maybe anyway?

bozhidar12:06:18

to be able to help you we need exact steps to reproduce the problem

bozhidar12:06:53

a simple project + those steps in generally the quickest path to a problem’s solution

bozhidar12:06:20

it’s unlikely that your problem is related to #950

andrea.crotti13:06:49

GNU Emacs 25.0.50.1 (x86_64-pc-linux-gnu, GTK+ Version 3.10.8) of 2015-05-19 on lcy01-07

andrea.crotti13:06:00

CIDER 0.10.0snapshot (package: 20150629.2315)

andrea.crotti13:06:06

and all I did is:

andrea.crotti13:06:13

- cider-jack-in

andrea.crotti13:06:16

- cider-refresh

andrea.crotti13:06:25

but I actually saw the same issue with another project of mine, if in the repl I do (clojure.test/run-all-tests) it works

andrea.crotti13:06:49

so it loaded correctly I just can't load files and refresh, in my own project I more or less solve by loading files in a certain order

bozhidar14:06:18

btw, as I mentioned on the other ticker I wonder if the same problem happens if you just invoke tools.namespace.repl/refresh from the REPL

bozhidar14:06:58

as cider-refresh is a wrapper around this function (to some extent - it actually uses lower-level code to provide better editor experience)

andrea.crotti14:06:50

what do you mean by tool.namespace.repl @bozhidar ?

andrea.crotti14:06:03

there is clojure.tools but that doesn't contain a namespace

andrea.crotti14:06:22

and nothing starting with tools

bozhidar14:06:24

it’s not visible in the package version of cider-nrepl

bozhidar14:06:38

as the dependencies are being renamed by mranderson

bozhidar14:06:49

(a lein plugin that does source rewriting)

bozhidar14:06:58

to avoid conflicts with user deps

bozhidar14:06:27

you can just add tools.namespace as a dependency to your project

bozhidar14:06:32

and see if it works

andrea.crotti14:06:00

ah ok well another issue now is that in this repl I don't see any output

andrea.crotti14:06:01

code-maat.cmd-line> (tools.namespace.repl/refresh) code-maat.cmd-line> code-maat.cmd-line> (+ 1 2) code-maat.cmd-line>

andrea.crotti14:06:05

I think because of the error I got before

andrea.crotti14:06:48

mm and now I'm getting out of memory because I have 4 java processes eating all the memory..

andrea.crotti14:06:59

when I kill the cider buffer it doesn't seem to kill the process is that normal?

andrea.crotti14:06:59

nrepl-server run *nrepl-serve... /dev/pts/21 /bin/bash -c /home/andrea/.local/bin/lein repl :headless nrepl-server<1> run *nrepl-serve... /dev/pts/35 /bin/bash -c /home/andrea/.local/bin/lein repl :headless nrepl-server<2> run *nrepl-serve... /dev/pts/36 /bin/bash -c /home/andrea/.local/bin/lein repl :headless nrepl-server<3> run *nrepl-serve... /dev/pts/37 /bin/bash -c /home/andrea/.local/bin/lein repl :headless

andrea.crotti14:06:49

and last thing which annoys me (general Emacs issue maybe) is that I can't get to the source of an Elisp function

andrea.crotti14:06:51

(cider-refresh &optional ARG1) Cannot open doc string file "/home/andrea/.emacs.d/elpa/cider-20150629.637/cider-interaction.elc"

andrea.crotti14:06:59

but the cider-interaction.el file is there in the same directory

bozhidar15:06:35

you’ve likely reinstalled cider within your current Emacs session

bozhidar15:06:00

package management is a bit fucked-up and it’s generally best to restart Emacs after upgrading packages

bozhidar15:06:44

the documentation lookup doesn’t work because it’s trying to access files from the older installation of cider you had prior to updating it

andrea.crotti15:06:23

ah right that's probably it @bozhidar

andrea.crotti15:06:39

actually I would just like to not upgrade everything all the time and just upgrade on stable new versions

andrea.crotti15:06:50

but I still didn't understand if and how I can do that

andrea.crotti15:06:37

what about the other question with the repl not being killed?

andrea.crotti15:06:53

I guess I just have to kill the nrepl buffer to kill the java process and not just the cider one is that right?

bozhidar15:06:36

on most systems killing the REPL buffer kills the underlying process

bozhidar15:06:39

but not on Windows

bozhidar15:06:52

I’m guessing you’re a Windows user? simple_smile

andrea.crotti15:06:37

thanks God I'm not

andrea.crotti15:06:42

Ubuntu 12.04 n ow

malabarba15:06:38

@andrea.crotti I don't know if this matters here, but there are two buffers, the repl and the nrepl. I always have to kill both in order to kill the process.

andrea.crotti15:06:08

yeah that's what I realised today @malabarba

andrea.crotti15:06:22

I thought killing the repl was enough until then

malabarba15:06:42

Cider should probably hook the two buffers together so that killing one kills the other too. What do you think @bozhidar ?

malabarba15:06:36

Also @andrea.crotti , one way to only get stable upgrades is to not use Melpa, only Melpa-stable

andrea.crotti15:06:57

ah cool didn't know that @malabarba thanks

malabarba15:06:52

And don't forget to mark your cider-nrepl dependency as 0.9.1 (no snapshot)

bozhidar15:06:00

when you use cider-jack-in, the nrepl-server buffer is the one being backed by the process used to start the nrepl server (e.g. lein)

bozhidar15:06:28

the REPL buffer is backed by the actually connection between cider & the nREPL server

bozhidar15:06:02

I didn’t pay enough attention to the output you’ve posted

andrea.crotti16:06:09

maybe someone knows here, is there a valid reason why if I write "; TODO: something"

andrea.crotti16:06:28

it gets indented in weird places and not at the same levels as the rest

andrea.crotti16:06:34

I suppose it's not the way people do it then..

cristian16:06:07

I've noticed that too. Have you tried using double semicolon? ;; TODO: something

malabarba17:06:40

That's the standard style for elisp, isn't it the same for clojure?

andrea.crotti17:06:58

yeah right double semicolon works

andrea.crotti17:06:34

annoying because comment-start for clojure-mode is the single semicolon

andrea.crotti17:06:40

so my automated function doesn't work

andrea.crotti17:06:41

(defun yas-with-comment (str) (format "%s%s%s" comment-start str comment-end))

andrea.crotti17:06:12

I can just override it anyway

malabarba17:06:16

One ; is for end-of-line comments. Two ;; is for indent-with-code comments. And ;;; or more is for beginning of line comments

roberto17:06:30

is there a way to make cider work with clojurescript? I’m a total newbie, been using emacs for about 4 months.

andrea.crotti17:06:15

ah right that explains it

andrea.crotti17:06:29

I just override the snippet then I guess @malabarba

bozhidar18:06:56

that’s a feature, not a bug simple_smile

bozhidar18:06:04

@roberto: well, it works with ClojureScript out-of-the-box (piggieback & figwheel are both supported), but not all of the standard features work with cljs (at least not yet)

roberto18:06:28

okay, thank you

enn18:06:18

How can I jump to the Java source for a Java method from a Clojure file?

ppold19:06:15

I think it is by executing ‘cider-find-var’ over the java method you want to jump to

bozhidar19:06:51

but this will work only if the java source artefacts are somewhere on the classpath

enn19:06:25

OK … Clojure is my first JVM language so I’m not super familiar with maven, etc. How might I go about getting the source artifacts for a library dependency and making sure they are in the classpath? Right now it looks like I only have the compiled class files in my local Maven.

bruceadams22:06:21

@enn Java IDEs, such as Eclipse, will automatically grab source code the moment you ask to look at it.

bruceadams22:06:32

I don't know if cider and related stuff will do that.

malabarba23:06:33

Usually the source is pulled in by lein

malabarba23:06:26

I never did anything special in that regard, but I can visit the source of any clojure Var, for instance.

malabarba23:06:20

They're always under ~/.m2 for me