Fork me on GitHub
#cider
<
2018-04-03
>
grzm02:04:09

any pointers on compiling/recompiling .java files using boot and CIDER?

richiardiandrea02:04:45

is refactor-nrepl a hard dep? I thought it was injected but I get a Exception in thread "main" java.io.FileNotFoundException: Could not locate refactor_nrepl/middleware__init.class when launching with clojure-cli. Possible problem?

richiardiandrea02:04:37

only tools.nrepl and cider/cider-nrepl get injected

dpsutton02:04:22

You're positive you don't have any deps files laying around bringing it in?

richiardiandrea02:04:34

No actually once I add it to deps.edn things have started working

richiardiandrea02:04:58

the vanilla command was: clojure -Sdeps '{:deps {org.clojure/tools.nrepl {:mvn/version "0.2.13"} cider/cider-nrepl {:mvn/version "0.17.0-SNAPSHOT"}}}' -e '(require (quote cider-nrepl.main)) (cider-nrepl.main/init ["refactor-nrepl.middleware/wrap-refactor"])'

richiardiandrea02:04:09

so no refactor-nrepl in there

richiardiandrea02:04:32

but you can see "refactor-nrepl.middleware/wrap-refactor" in there

bozhidar04:04:19

@richiardiandrea It’s a dependency of CIDER, but I think it’s almost a hard dependency of clj-refactor.el. It has a separate setting about injecting it on cider-jack-in, which is t by default.

richiardiandrea04:04:59

Oh ok, it makes sense because I think I am not requiring that anymore 😄

bozhidar04:04:01

@grzm There’s no special functionality about working with Java source files in CIDER.

grzm04:04:24

@bozhidar so, if I have a repl open, and I make a change to a .java source file, how do I get that to be recompiled? Does that happen automatically?

dpsutton04:04:56

How would that happen in lein?

grzm04:04:38

@dpsutton If that's directed at me, I dunno. If I've tried this in lein before, it's faded into the fog of my memory

dpsutton04:04:18

I don't know how to do it either. But cider just calls up lein and then has a few new ops in the nrepl protocol is all. I don't think there's a way right now

arrdem07:04:20

Virgil is my single favorite Clojure tool. Besides CIDER 😛

bozhidar08:04:19

@arrdem When do you expect to finish the REPL images functionality? As it stands it and @gonewest818’s work on the result/output truncation are the final two things for 0.17. 🙂

gonewest81820:04:36

I was mostly off grid for a week of spring skiing, and now engaged in interviews (hire me!) as well. So time is tight but I’ll renegade hopefully over the weekend.

gonewest81820:04:59

s/renegade/re-engage/

arrdem14:04:12

@bozhidar I'm honored. this coming weekend maybe, I'm up against a work deadline atm and taking the end of the week off during which time I'll probably not let myself have a laptop.

bozhidar14:04:18

No worries!

ajs18:04:20

I rely on M-/ to autocomplete fn names and generally find that enough, but what I'm wondering if it's possible for that to work on a namespace, i.e. if i type some-ns/... anything after the / will not autocomplete because it is assumed to be part of the entire form (unless I've previously typed that entire form with the ns). Any way to get around this?

dpsutton19:04:28

I'm not sure I follow. Can you explain with more concrete name spaces? Suppose your in foo/core.clj and you have another namespace called foo/bar.clj

ajs19:04:21

do you use built-in emacs fn for autocompletion dabbrev-expand? if so, is there a way to get it work on a name, excluding the namespace and slash, such that if you have a (defn some-fn []...) you can get autocomplete on foo/some-fn which it normally will not do unless you have previously typed foo/some-fn somewhere

ajs19:04:35

dabbrev-expand includes the ns and slash as part of the pattern match and therefore will not match on just the fn name after the slash. I'd like to type foo/so... and get it to autocomplete foo/some-fn

bozhidar19:04:50

@ajs Why don’t you use the much smarter completion-at-point (`M-Tab`)?

bozhidar19:04:10

That’s one of the nicer things about using something like CIDER.

ajs19:04:40

trying it now, does seem to be better. is it a Cider-related fn, or just generic emacs?

ajs19:04:48

i see there is also complete-symbol

ajs19:04:59

man there are a lot of completion options in emacs

bozhidar20:04:37

That’s CIDER-specific - generates completion candidates from the actually running REPL. It does’t get much better than this. 🙂

arrdem22:04:58

does nREPL have a way to do array responses?

arrdem22:04:56

Trying to get my mind off some stuff at work and looking at adapting my REPL images changeset to sorta comply with https://tools.ietf.org/html/rfc1521#section-7.3.3 which seems to send a pair of content-type headers.

arrdem22:04:05

Eg. What my image display middleware really does is according to 1521

Content-Type: message/external-body; access-type=local-file; name="/home/arrdem/img.png"
Content-Type: image/png
In that the server is directing the client to fetch some other content, which has the SECOND type.

arrdem22:04:23

cc @cemerick if you’re so inclined

arrdem22:04:16

I suppose it wouldn’t be wrong to do something like have an External-Body-Content-Type: ... part, it just wouldn’t be to the RFC. But nREPL is a different protocol than mail transfer so it’s not really a problem, just need to pick something.

cemerick22:04:18

@arrdem sure, you can toss a vector in an nrepl response

arrdem22:04:22

@cemerick would you choose a different structure here rather than trying to shoehorn MIME stuff in?

arrdem22:04:34

MIME seems to be the majority of the prior art which is why I’m trying to adapt it…

cemerick22:04:30

Sending along a mime type probably makes sense. I dont know hiw much the rest of the actual mime specs help.

arrdem22:04:07

Right so what I’ve got right now is an nREPL middleware which recognizes AWT images, and returns them as base64'd data with a MIME type. That totally works and is well explored.

arrdem22:04:31

The “problem” here is that I want to support rich content handling for files which happen to be images.

arrdem22:04:40

Without having nREPL do the slurp and transport.

arrdem22:04:24

RFC1521 defines the above … dance for messages which want to refer to external message bodies.

arrdem22:04:00

Although I suppose that in the embedded nREPL case, you want nREPL to transport the file. Humm.

cemerick22:04:24

That's exactly what an early version of nrepl did, based on a set of capabilities the client reports upon connection.

cemerick22:04:02

You'll want to use the binary transport option tho

arrdem22:04:56

Is there a good way to figure out if nREPL is on the same host as the client?

arrdem22:04:06

I presume not…

arrdem22:04:40

the heck with it. Just gonna slurp and base64 all files and we can iterate.

arrdem22:04:45

want this code merged and off my desk.

arrdem23:04:28

Okay. How’s this for an idea - add a “slurp” op which handles URIs on the server. This way we do a two-step dance where the initial eval op produces a content-type’d response, and then the client can choose to follow up with a slurp to fetch the contents of the remote file.

cemerick23:04:17

The land war of resource lifetimes