Fork me on GitHub
#cursive
<
2018-05-08
>
hlship00:05:15

It looks like Cursive marks a Java class import as unused if it is present only for a type cast.

cfleming00:05:25

@hlship Do you mean in a metadata hint, i.e. ^MyObject obj?

cfleming00:05:29

@akiel No, it’s not yet, I need to update the doc for that. Basically you can select any var available in your project to resolve as, not just the predefined list.

hlship00:05:32

(log/trace :event :master-loop
               :zk-id zk-id
               :client-id (str "0x" (Long/toHexString (.getSessionId ^ZooKeeper client))))
is in my code, but the import of ZooKeeper is flagged as unused.

cfleming00:05:59

Hmm, odd - I’ll check that.

cfleming00:05:50

@teng That’s very odd, I’ll take a look at that. Which JVM version are you using for your app?

cfleming00:05:41

@danielcompton I actually don’t know what the difference between those two files is.

cfleming00:05:15

@joelsanchez In your application, you mean? No, you can’t, since it’s stored on the client side of the nREPL connection, in Cursive

cfleming00:05:23

@ramblurr yes, it should work for CLJS. However there’s a bug where that popup isn’t shown at the definition of your defxxx, you’ll have to use the intention from a usage, i.e. where you actually use it like (defxxx ...)

tengstrand05:05:23

@cfleming I use Project SDK 1.8 (1.8.0_151)

Casey06:05:52

@cfleming Ah thanks, using the intention from a usage point works.

Casey06:05:42

Hmm there is something strange though

Casey06:05:54

I'm using specter, which defines a defnav macro.

Casey06:05:02

No intentions popup on that defnav line.. when i press alt+space it says "the file is read only" (this is a specter library file)

joelsanchez07:05:53

@cfleming no, I meant in the REPL, inside Cursive. instead of just using the arrows, can I do a filter on the history to find what I want? (like history | grep ...)

akiel08:05:54

@cfleming I tried the var of my macro. It even has specs. But I think I need something special in the spec to mark binding forms.

Mudge13:05:38

In Cursive "defn" cannot be resolved. How do I fix this?

Mudge13:05:14

@cfleming Cursive says "defn" cannot be resolved. How do I fix this?

Mudge14:05:05

I want to get this fixed because the indentation for defn is broken because it cannot be resolved

danm14:05:29

@nick319 Sounds like it's not correctly recognised your Clojure project. Have you added your project.clj as a Leiningen project in IntelliJ? And does that correctly reference your source and test directories as such

Mudge15:05:46

@carr0t yes. And it was all working, and then it stopped working

Mudge15:05:22

@cfleming @carr0t I just noticed that cursive has this error:

Casey17:05:29

I can't find docs on how to start a clojurescript node repl?

Casey17:05:57

my goal is to get test integration working with clojurescript + doo

Casey17:05:03

is this possible?

cfleming22:05:45

@ramblurr I’ll check that Specter case

cfleming22:05:47

@joelsanchez The thing is, when the code you type in the REPL is executed, it’s executed in the REPL process, i.e. in your application. This is a separate process from the IDE itself, which is where the history is stored.

cfleming22:05:07

So the IDE is the client of the REPL connection, and your app is the server.

cfleming22:05:42

@akiel Ah, I see what you mean. Unfortunately this won’t work yet, unless your macro looks just like one Cursive already understands (i.e. a new binding form that looks like a let, or a defxxx form or something similar).

cfleming22:05:41

@nick319 Does that happen on all files, or just on one specific one?

joelsanchez22:05:21

@cfleming sure but, suppose I want to evaluate this

(->> @cursive-history (filter (fn [s] true)))
cursive could send this to the server (unbeknownst to the user of the repl):
(with-local-vars [cursive-history [:whatever :history :cursive :has]]
  (->> @cursive-history (filter (fn [s] true))))

joelsanchez22:05:17

alternatively, if Cursive sends to the server (ns cursive) (def history ...) before anything else, maybe that would make it possible to access cursive/history?

cfleming23:05:42

@ramblurr re: the CLJS REPL, this is still a little janky but will get better soon. Unfortunately the test integration doesn’t work for CLJS yet, although I hope to fix that soon too.

cfleming23:05:30

@joelsanchez Sure, I see - it’s an interesting idea. I’m actually toying with some ideas about how to make the REPL more interactive at the moment, with more bidirectional communication between the server process and the IDE.

cfleming23:05:01

What’s your use case for the history filtering?