Fork me on GitHub
#cider
<
2018-02-22
>
bozhidar02:02:18

Yeah, we should probably find some time to fix the problem with excessive output being dumped in the REPL. A relatively simply solution would be to just count the size of the output and trim it client side, but a better solution might be to enhance the eval middleware to be smarter about this.

bozhidar02:02:33

And the previous broad discussion of how Clojure programming is different from C++ programming reminded me of an old idea we had to add some indicator whether a ns is loaded/in sync with the source buffer and maybe leverage this in commands like find-var.

bozhidar02:02:12

I don’t know how many of you have noticed it, but once you evaluate an expression a small indicator appears next to it and and it disappears if you change the expression.

bozhidar02:02:23

That was another step in this general direction.

wusticality03:02:56

Is there some way to use *cider-scratch* as it’s own namespace so I can import a bunch of packages into it? At the moment I’m doing something horrific like (def thing (require 'a.b.c.d.e.thing)) 😕

wusticality03:02:46

the problem i’m trying to solve is referencing a lot of various namespaces by a short name (aka, what (ns ..) does) in the scratch buffer

Drew Verlee04:02:45

Cider debugger is awesome. thats all i got

Drew Verlee04:02:42

is cider trace any different then what sayid does?

dpsutton04:02:18

@iwannaseethelight can you not just (do (require 'ns1 :as alias1) ...)??

wusticality04:02:11

yeah i guess that works, just sorta clunky

wusticality04:02:22

on an unrelated note, I think i’ve discovered a bug of sorts

wusticality04:02:47

if you have some namespace like (ns a.b.c.foobar (:require [a.b.c.user :as user])

wusticality04:02:29

and you switch to that namespace in the repl, and then type user/ you will not get autocompletions for that namespace - it seems to be related to the fact that cider uses the user namespace and treats it specially

wusticality04:02:46

super frustrating though, this big codebase I’m working on uses user as a namespace alias in so many files 😕

dpsutton05:02:44

i'm looking around and i'm not seeing where that bug could be

dpsutton05:02:00

i'm guessing it will be in complement

gonewest81805:02:11

Are you aware of any special handling for ns user? That would surprise me.

dpsutton05:02:13

not that i know of

dpsutton05:02:23

looking in CIDER, CIDER-nrepl and compliment

dpsutton05:02:26

not seeing anything

dpsutton05:02:17

gonna try to replicate it

gonewest81805:02:06

maybe a conflicting namespace? Like is the project has :profiles {:dev {:source-paths ["dev"]}} and a dev/user.clj which would conflict with [a.b.c.user :as user] ?

dpsutton05:02:17

i can replicate it though

dpsutton05:02:29

user is "special" in clojure

dpsutton05:02:46

didn't know that it got treated differently in the CIDER stack

dpsutton05:02:07

and it seems entirely predicated on the user prefix

dpsutton05:02:24

if i change it from user to usern the autocompletions work

gonewest81805:02:25

oh, right. user gets clojure.core for doc and so forth…

gonewest81805:02:58

sorry, that’s not a reply to you, just me remembering.

dpsutton05:02:39

no worries. i know its special but i didn't know what was in it

dpsutton06:02:50

ah got the error. its in compliment

dpsutton06:02:59

(defn resolve-namespace
      "Tries to resolve a namespace from the given symbol, either from a
      fully qualified name or an alias in the given namespace."
      [sym ns]
      (or (find-ns sym) ((ns-aliases ns) sym)))

dpsutton06:02:17

and this is actually a really bad thing. if an alias is the same as a single segment namespace you'll get backwards results

wusticality20:02:11

yeah i wondered if there was a ticket for this already 🙂

dpsutton06:02:41

the gist is that it's trying to find out what namespace user is pointing to. and to do that it needs to see if there is an alias first, because it just so happens that user will refer to the special namespace so (find-ns user) returns that one

bozhidar12:02:40

> is cider trace any different then what sayid does?

bozhidar12:02:11

It’s useful for quickly debugging recursive functions without having to step through them. At least this is the primary way in which I’m using tracing myself.

dominicm13:02:48

Sayid has more detail than cider's trace.

bozhidar13:02:23

Ha, I had never heard of it, but it looks like a cool project. It even has CIDER integration.

bozhidar13:02:18

The tracing in CIDER is just a very thin wrapper over tools.trace, which is useful, but definitely not fancy.

dominicm13:02:36

@bozhidar sayid is pretty great. I want to integrate it into replant at some point.

dpsutton14:02:30

could we hook up this slack to the CIDER and CIDER-nrepl github projects so that issues and PR's show up here? would that be a welcome feature so that people could see the activity as it happens? or is it better for people to optionally subscribe to that as they like

dominicm14:02:29

I'm not sure there's a lot of value for most people in this room. But maybe it would encourage more people to get involved.

dpsutton14:02:03

yeah i'm not convinced about it either. just musing

dpsutton14:02:14

but i'm all about new contributors

dominicm14:02:08

My energy levels in my spare time has been pretty low lately, not enough to muster up contributions, so I'd welcome others to come fill those gaps 😁

dpsutton14:02:04

i'm busy with school and work so i have way less time to contribute. so i just follow along. i couldn't sleep last night so i did that at midnight instead of sleep

dominicm14:02:44

I know that compulsion.

dominicm14:02:59

I couldn't think of a way to describe it that's healthy. So it's just strikethrough.

dominicm14:02:40

I know that contributors attitude! – starting to get eerie.

dpsutton14:02:00

@gonewest818 your code coverage changes and general infrastructure improvements are super nice!

bozhidar15:02:37

Well, if someone knows what has to be done here to show those notifications - I can certainly do it.

gonewest81815:02:54

I’ve seen them in http://irc.gitter.im, because of their “we integrate tightly with git” thing.

dpsutton15:02:54

just need an admin to add the relevant hooks

dpsutton16:02:21

sean mentioned that github integrations are open for anyone so we just need to do it

bozhidar17:02:23

Seems to be working.

dominicm17:02:02

I like the icon

dpsutton17:02:06

awesome. hopefully people click on pull requests to see how easy some changes can be.

bozhidar17:02:43

Yeah, that’s what I hope as well.

dominicm17:02:39

I know that tooling code is inherently pretty ugly. But cider's is basically only "ugly" in the sense that I consider it "archaic" clojure, which makes sense given it's age.

xiongtx18:02:20

What is this New Age clj you speak of?

mikerod17:02:25

> see how easy some changes can be Hah, funny the commit that showed up first from the github integration

mikerod17:02:31

Easy change indeed 😛

wusticality20:02:50

@dpsutton - may bitcoin shower upon you from above, thanks for fixing that user/ completions bug, made my week

dpsutton20:02:23

for sure. have you received the fix? i'm not sure but cider-nrepl may publish itself automatically after commits now. maybe try blowing away ~/.m2/repository/cider and seeing if you get the new version

dpsutton20:02:40

i tested that it worked for me. but i can't imagine the pain of a widely used namespace having no autocompletes

wusticality21:02:51

yeah it’s on melpa already

wusticality21:02:15

do you know if there’s a method in cider to find all references to a symbol / method?

wusticality21:02:26

aka, find usages

gtrak21:02:50

i use projectile-helm-ag for this

gtrak21:02:22

s/projectile-helm/helm-projectile

dpsutton21:02:34

just recently added helm-ag-project root. it doesn't obey the excluded dirs so had to kinda hack it

dpsutton21:02:42

in dir locals i mean

wusticality21:02:24

yeah i’m using that too - one thing on that is i wish the filter affected the file names

wusticality21:02:29

java packages are such a pita 🙂

wusticality21:02:47

i need to bind helm-ag-project to a hotkey already

wusticality21:02:48

i also need to show the entire package name in the modeline for clojure files, i can never remember what package i’m in

dorab22:02:00

When I write code in a file with ns foo I like to have a (comment ... section at the end with sexprs that I use for testing. I was wondering how I could send each sexpr to the REPL but with the namespace of the REPL, not foo (as cider-eval-last-sexp-to-repl does).

xiongtx22:02:22

You can change the namespace of the REPL w/ cider-repl-set-ns.

dorab23:02:52

Right, but I was hoping to keep the namespace of the REPL something else (e.g. user)

dpsutton22:02:15

C-c m-p will send the last form to the repl

dpsutton22:02:31

Not namespace aware I think. Just drops the form on the repl

dorab22:02:04

Right, but then I have to type <return> in the REPL to eval it. Was hoping for something like cider-eval-last-sexp-to-repl but using the REPL's current ns. Currently using C-c M-e and polluting the foo namespace in the REPL with my test vars.

russell22:02:46

@dorab

(defun form-to-repl ()
  (interactive)
  (let ((code (cider-last-sexp)))
    (with-current-buffer (cider-current-repl-buffer)
      (end-of-buffer)
      (insert code)
      (cider-repl-return))))

dpsutton22:02:52

I would copy and paste the eval function into your init and modify it to not do the ns check

dpsutton22:02:18

Or that. :)