Fork me on GitHub
#cider
<
2017-04-10
>
qqq03:04:58

holy %*#(; cider-apropos is amazing;

qqq03:04:08

I rejoined this channel just to say helm-cider / cider-apropos is amazing

bozhidar04:04:04

@pesterhazy I mentioned there’s not an EDN parser I’d use

bozhidar04:04:24

edn.el depends on a an unmainted library hosted on EmacsWiki…

bozhidar04:04:23

perhaps it’s perfect, but I kind of doubt this

bozhidar07:04:52

@qqq Happy to hear you like it!

bozhidar07:04:25

there’s a version of this that searches in docstrings which is also quite useful

benedek07:04:48

hm.. @bozhidar did not know about your concerns re. edn.el

bozhidar07:04:03

I’ve definitely mentioned this to Lars. I told him I’d never add a dependency to any of my packages to something unmaintained that doesn’t even have an official repo.

bozhidar07:04:29

If the situation was different maybe CIDER would have used this library as well.

bozhidar07:04:38

On a related note - this library should probably live in clojure-emacs to raise its visibility and maybe attract more developers.

benedek07:04:11

you mean edn.el?

pesterhazy07:04:22

searching in docstrings, genius

qqq07:04:28

@bozhidar: I've noticed a few "click here" to find cider links on tthe github and documentation; is there a price at which you would be able to hack on cider full time for a year?

bozhidar08:04:45

There’s always a price. 🙂 If I could raise something in the vicinity of 100k for a year, I’d definitely consider doing this. At some point I dreamt of some company seeing the benefits of developing a good tooling for Clojure and hiring me to work on it, but several years down the line this doesn’t seem like something that’s ever going to happen.

bozhidar08:04:36

@pesterhazy well, the genius idea was Emacs’s and it was afterwards copied by SLIME and eventually by CIDER

benedek08:04:20

@bozhidar haha i see rewrites all around

bozhidar08:04:04

rewrites of apropos?

bozhidar08:04:20

guess you can say this 🙂

benedek08:04:35

haha sorry i meant edn.el needs a bit of rewrite to get into clojure-emacs but you are right indeed that conversation is kinda about rewrites too…

bozhidar09:04:03

edn.el can go to clojure-emacs even in its current form, I’d just not advice its usage until it’s clear what to do about peg.el

qqq11:04:55

@bozhidar : 100k / year is low end of SV salary; so completely reasonable for full time cider dev

qqq11:04:26

@bozhidar : is there a price you would consider porting cider to some editor that was clj/cljs all the way down? or are you fundamentally stuck with emacs and unwilling to build the core of it in clj/cljs ?

bozhidar11:04:34

well, I’m an Emacs user and CIDER started off as a very personal project for me - I planned to start doing Clojure professionally and I needed good support for Clojure in Emacs

bozhidar11:04:48

I’m not opposed to doing something similar for a different editor in principle as I love working on developer tools, but with another editor matching the exact CIDER feature set might be harder (or easier).

bozhidar11:04:14

Even know a lot of the heavy-lifting is done in cider-nrepl which is editor-agnostic and implemented in pure Clojure

qqq12:04:46

@bozhidar : so 200k? 🙂

qqq12:04:12

I think as a community, one of the best investments lcojure devs can make is getting an clojure ide written in clojure

bozhidar12:04:36

on one hand you’re right, on the other - developing an IDE from scratch is a lot of work. It’s much more than just coming up with support for one particular language. It might be fun to work on such a project, I’m just not sure how feasible it would be to build something like this. Most new IDEs/text editors don’t get very far - e.g. NightCode, LightTable, etc.

qqq12:04:21

yeah, there's annoyances on both parts: every time I try to hack on nightcode/lighttable, it just feels too primitive compared to emacs every time I write elisp, I curse and wish I was using cljs

qqq12:04:41

If, hypothetically, we got you 300k, would you be able to hack on it full time for two years?

bozhidar12:04:31

I’m not Elisp’s biggest fan myself, but I prefer an editor extensible in some dialect of Lisp, compared to something else. Plus, I’ve been using Elisp for quite a while and it almost feels like a real programming language.

bozhidar12:04:46

hypothetically - yes

qqq12:04:13

I am having the following problem with helm-imenu. I don't want it to use imenu--create-index. I want to create the indev sia: (imenu--generic-function imenu-generic-expression) how do I pass this to the (helm :sources ( ... :candidates ... )) call ?

qqq13:04:41

got it working; it was a regex issue

jfntn16:04:21

Is there a way to get jump to source to work for clojure protocols like clojure.lang.Associative? Suspecting something is wrong with my javadoc setup because the javadoc like in cider doc doesn’t do anything…

jumar17:04:12

@jfntn I think not - at least it doesn't work for me, since it's implemented as a java class. It'd be great if someone more involved like @bozhidar could provide a definitive answer on this, i.e. if it's possible to navigate to the source code of Clojure's java classes like clojure.lang.PersistenceVector or clojure.lang.Associative

bozhidar18:04:32

It should work provided you have sources in your classpath. Same applies for javadoc.

jumar19:04:55

@bozhidar thanks for the tip - what's the easiest way of adding the Clojure sources to classpath? (I'm using leiningen)

jumar19:04:27

And following seems to work:

:profiles {:dev {:dependencies [[org.clojure/clojure "1.8.0" :classifier "sources"]]}}

jfntn20:04:43

Ha that worked, can now jump to clojure protocol definitions in Java!

bozhidar21:04:30

yeah, probably someone should add this somewhere in the manual

bozhidar21:04:35

or work on this ticket 🙂

qqq21:04:13

1. I have cider-connect working. 2. I can evaluate cider forms in my *.clj file. 3. When I type in M-x cider-apropos <RET> assoc! <RET>, I get: Wrong type argument: stringp, nil How do I debug this?

tanzoniteblack21:04:24

toggle-debug-on-error is always your friend for things like that

qqq21:04:26

using toggle-debug-on-error, I get:

dpsutton21:04:46

it's saying unknown operation

dpsutton21:04:06

can you M-x something along the lines of nrepl-toggle?

dpsutton21:04:18

if we can see what it's sending across to the jvm we can see what it's erroring

dpsutton21:04:39

but open a ticket as it sending back bad info shouldjn't error like that

dpsutton21:04:58

nrepl-toggle-message-logging

qqq21:04:26

I don't have nrepl-toggle . I only have nrepl-toggle-message-logging . Also, I'm cider-connect -ing to a remote nrepl.

dpsutton21:04:49

yeah that. i meant something along the lines of that. i never remember what it is

dpsutton21:04:06

turn that on, do the command that you're doing, looks something to do with docs, and paste those messages here

qqq21:04:14

(updated to include nrepl buffer)

qqq21:04:43

@dpsutton: in the cider repl what am I supposed to type to emulate looking up info on clojure.core/assoc! ?

qqq21:04:55

(info 'clojure.core/assoc!) <-- error about symbol cannot be cast to java.lang.String

qqq21:04:00

(info "clojure.core/assoc!") <-- nil

dpsutton21:04:00

can you tell me what has id 14?

dpsutton21:04:28

see how they each have an id on them? the error message coming back unknown op is keyed to id 14 which is just out of range in the screenshot you sent

dpsutton21:04:24

just turn on the message logging, do whatever you did to trigger the error and let's look at ti

qqq21:04:05

will you still be around in 5 minutes?

qqq21:04:10

if so, maybe I should just screen cast

dpsutton21:04:17

are you able to reliably trigger that error?

qqq21:04:24

every time

dpsutton21:04:33

and you turned on nrepl logging

dpsutton21:04:37

notice the error message that it's saying

qqq21:04:58

let me get you full error

dpsutton21:04:12

let's see if we can see what request is triggering that

dpsutton21:04:24

so let's trigger the error, go look at the nrepl logs, and see what request triggered it

qqq21:04:51

(--> 
  op  "info"
  ns  "z.mdb"
  symbol  "n"
  session  "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
  id  "25"
)
(<-- 
  id  "25"
  op  "info"
  session  "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
  status  ("done" "unknown-op" "error")
)
(--> 
  op  "apropos"
  ns  "z.mdb"
  query  ""
  filter-regexps  ("^cider.nrepl" "^refactor-nrepl" "^clojure.tools.nrepl")
  session  "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
  id  "26"
)
(<-- 
  apropos-matches  ((dict "doc" "Returns the product of nums." "name" "clojure.core/*" "type" "function") ...)
  id  "26"
  session  "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
  status  ("done")
)
(--> 
  op  "info"
  ns  "z.mdb"
  symbol  "clojure.core/assoc!"
  session  "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
  id  "27"
)
(<-- 
  id  "27"
  op  "info"
  session  "b9a9b0fe-03fa-427e-9bb5-84c46bc2f3ad"
  status  ("done" "unknown-op" "error")
)

dpsutton21:04:47

well it certainly doesn't like you asking for info does it

dpsutton21:04:16

what command in cider are you using?

qqq21:04:30

you know what's relaly fucked up? cider-apropos-documentation <- will actually show me the docs for assoc! in the helm window

qqq21:04:33

I was using cider-apropos

qqq21:04:07

cider-apropos + assoc! + RET<-- error we get cider-apropos-documentation + assoc! (no RET) <-- completion window shows the documentation

dpsutton21:04:29

try it without the !

dpsutton21:04:38

does cider-apropos + assoc work?

dpsutton21:04:59

damn, it works for me

qqq21:04:04

hmm, I have crashed emacs now

dpsutton21:04:08

but i haven't updated on my windows work computer in a while

dpsutton21:04:22

someone recently added support for some datomic stuff and its possible they borked it a little

dpsutton21:04:40

yeah, assoc! works for me

dpsutton21:04:47

are you running CIDER from melpa?

qqq21:04:14

emacs: using cider from nrepl; boot: cider/cider-nrepl 0.15.0-snapshot

dpsutton21:04:40

I think that's melpa then

qqq21:04:28

cider-apropos + assoc + RET <-- same stringp error

qqq21:04:57

so maybe my emacs cider is out of date

dpsutton21:04:59

can you eval this? (cider-ensure-op-supported "apropos")

dpsutton21:04:07

i would nuke your cider and reinstall, yeah

dpsutton21:04:20

that dynamic language is so easy to jump to source to look at something and accidentlaly press a key

qqq21:04:22

as an elisp command ?

qqq21:04:35

okay, time to nuke cider

dpsutton21:04:37

ok that's good

dpsutton21:04:52

yeah, i borked my copy of CIDER recently by having an a freefloating before a form

dpsutton21:04:01

had to find it before i could load the file

qqq21:04:33

oh, you're saying I did C-h f cider-function

qqq21:04:40

clicked on cider.el, looked at some stuff, hit some key, and now cider is borked?

qqq21:04:48

damn, emacs should make those files read only

dpsutton21:04:48

i've done that. possible that that has happened here, but not likely

dpsutton21:04:52

yeah i agree

dpsutton21:04:04

i had to recompile emacs recently because i did that in a native emacs lisp file

dpsutton21:04:13

make bootstrap after that one

qqq21:04:48

for some stupid reason, I always thought emacs packages were read only in /usr/local/... when they're clearly write-able in ~/.emacs.d/....

qqq21:04:14

nope, still borked

qqq21:04:24

I promise I didn't touch any cider files this time around

qqq21:04:27

wait wait

qqq21:04:39

cider-ensure-op-supported is SUPPOSED to return nil on succees and ERROR on fail

qqq21:04:42

nil = success

dpsutton21:04:52

error = bad, nil means continue control flow

jfntn23:04:18

@dpsutton I was trying to write an interactive function to start a standalone cljs repl. However I couldn’t get it to work since I was trying to access the repl buffer right after invoking cider-jack-in and the buffer didn’t exist yet. I took this from the sibling repl implementation so I’m not sure why that happened. Anything comes to mind?

jfntn23:04:27

Assuming cider-jack-in is async while some of the innards are sync, but I’m not familiar enough with cider’s internals to know where to start other than duplicating all of cider-jack-in and hard-wiring the sibling code in there…