Fork me on GitHub
#cursive
<
2019-09-04
>
Leon12:09:31

hey! I've got a problem: I just generated a clojurescript re-frame based project from a template, and tried opening it with cursive. in my code, it says it can't resolve defn and some other basic stuff. when trying to Refresh Leiningen Projects, it errors out with the following message:

Syntax error compiling var at (fipp/ednize.clj:71:13). Unable to resolve var: clojure.instant/thread-local-utc-date-format in this context
after some googling that error should be avoidable by setting an environment variable, but that doesn't seem to work for me. is there some trick needed to get Cursive to respect that variable? or is there maybe another fix for it? (i'd guess that that load error is the reason for it not recognizing defn and such)

manutter5113:09:32

What JDK version are you using?

Leon13:09:17

as project SDK? 1.8.0_192

manutter5113:09:20

Ok, that sounds good, what about IntelliJ version? There have been a lot of issues with 2019.1

Leon13:09:01

2019.2 Community

manutter5113:09:31

Ok, I’ve used 2019.2, and not had that problem

manutter5113:09:55

Maybe try under File -> Invalidate Caches & Restart?

Leon13:09:39

ill try ^^

Leon13:09:31

didnt help 😞

manutter5113:09:58

Ok, maybe your best bet is to downgrade to IntelliJ 2018.3 until they get the bugs fixed in 2019.x

Leon13:09:17

ill try, i think i might even have an older version laying around here haha

manutter5113:09:43

I’m on 2018.3.6, it’s working well

danieroux13:09:15

Downgrading to 2018.3.6 greatly increased my calm with IntelliJ

Leon13:09:08

wow now it actually works lol

Leon19:09:35

the "one-space list indent" formatting option is supposed to switch between something like this:

[:div
 [:h1 "foo"]
 [:div "bar]]
[:div "lkjasdf"]
and this:
[:div 
    [:h1 "foo"]
    [:div "bar"]]
[:div "lkajsdf"]
right? because for me, its always one-space indented which throws me off a looot

cfleming20:09:30

@lkowarschick The one-space setting only affects lists, vectors always get a one-space indent.

Leon11:09:45

is there any way to change that? it's really confusing to have a mix of one and two-space indentation...

serioga13:09:14

@lkowarschick it's not an identation by alignment of vector's elements...

Leon22:09:10

Maybe

[ :div
  [  :span "foo ] 
  [  :div "bar" ]]
?

Leon22:09:27

Space padded vectors?

cfleming23:09:09

I mean, it’s possible but honestly I think it’s a tricky solution. To my eye, that looks weirder than just single space vectors.

cfleming23:09:48

I suspect that the one-space indent is just something you’ll get used to, much like parens in general. The IdeaVim issue is trickier though. Is there no way to configure that behaviour?

Leon07:09:58

not that i know of... I'd say having a space-padded vector open would be a great solution for this problem, as it would also make indentation more regular in general. generally, I'd love to see comma-first style (like elm uses it) in clojure. it would pretty much be a perfect fit (i know commas are just whitespace, but when used as seperators for longer vecs (i.e. in hiccup) that could increase readability. space-padded vecs would be a great thing though, id love if the cursive team considered adding that option

dpsutton20:09:41

the downside of hiccup

danielcompton21:09:12

Does Cursive support :exclusions in tools.deps?

cfleming21:09:45

It just delegates all that to deps itself, so if deps supports it, Cursive should too.

danielcompton21:09:53

I have

tongue {:mvn/version "0.2.6"
                :exclusions [clojure-future-spec]}
but I'm still seeing it show up in symbol resolution and in the Clojure Deps browser

cfleming21:09:15

Do you see it in clj -Stree?

danielcompton21:09:35

The issue is I needed to specify it like this: [clojure-future-spec/clojure-future-spec]

cfleming21:09:59

Really? That seems like you could file a bug for that.

danielcompton21:09:06

Yeah, what is the way to file bugs now?

danielcompton21:09:14

Does it have to go through Ask Clojure first?

cfleming21:09:27

I think it’s still JIRA.

cfleming21:09:33

That I don’t know.

Alex Miller (Clojure team)21:09:16

if you have a jira acct, that's fine. otherwise, ask clojure

danielcompton21:09:39

Ah cool, wasn't sure if that was the new path for everyone

Alex Miller (Clojure team)21:09:40

I think you're actually seeing a bug fixed in the last release though

cfleming21:09:50

Alex, do you have an alert set up for “JIRA” or something? 🙂

Alex Miller (Clojure team)21:09:52

which is that exclusions don't get canonicalized

Alex Miller (Clojure team)21:09:17

try clojure-future-spec/clojure-future-spec above and see if that works

danielcompton21:09:33

Yep, that works

Alex Miller (Clojure team)21:09:36

oh you said that above already - I'm reading out of order

Alex Miller (Clojure team)21:09:42

so that's fixed in latest already

kenny21:09:04

Does the Reading project task execute in parallel? If not, could it?

kenny21:09:05

After discovering alt+shift+N a few weeks ago and loving it, I was wondering if there was a similar action to let me search for functions.

kenny21:09:42

I've been using ctrl+f but it's not ideal because it will also find things that are not vars.

cfleming21:09:30

@kenny It doesn’t, but it possibly could. It might be tricky, though. What I think will be easier will be to cache the results per module, and only re-read those that have changed. That should work well since normally none of them will have changed, and that’s easier (and probably more reliable) to implement.

kenny21:09:47

That would definitely be helpful. I only ever want to refresh things that changed, not everything.

cfleming21:09:10

Yeah, I’m planning to work on that along with the run classpath caching.

❤️ 8
cfleming23:09:50

@kenny What does alt+shift+N bring up for you? It pulls up a task list for me.

kenny23:09:35

Oh sorry, I guess that keymap changed from the default somehow. It's Navigate > Namespace

cfleming23:09:40

Second in that section

kenny23:09:54

Ah. It doesn't show up in my Navigate menu for some reason.

cfleming23:09:19

Really? You don’t see Navigate | Symbol…?

kenny23:09:37

Wait nevermind, it's way at the top. I expected it to be next to the other ones: Namespace and Keyword.

cfleming23:09:02

Symbol… is built into IntelliJ, it’s not a Cursive one.

kenny23:09:28

Got it. Can that search be limited to just the ns I'm in?

cfleming23:09:12

There’s a dropdown on the right of the popup with various scopes

kenny23:09:13

I see a filter icon but that only lets me filter by file type.

cfleming23:09:57

Probably “Open files” would be the closest

cfleming23:09:41

See where it says Project Files on the right?

cfleming23:09:21

But I don’t know why “Current file” doesn’t appear there.

kenny23:09:17

It looks like this for me.

cfleming23:09:52

Ah, ok, I’m on 2019.2 Preview, I guess they updated that

cfleming23:09:11

So you should have that soon.

kenny23:09:25

Still on 2018.3. Actually, I could probably update now that the dev build is working, no?