Fork me on GitHub
#cursive
<
2021-03-08
>
robert-stuttaford06:03:21

is there a way to make IntelliJ also highlight occurrences of Datalog variables?

mikejcusack14:03:16

I don't believe so. There's nothing special about them as far as Clojure is concerned. They're just regular symbols in a vector.

cfleming20:03:03

Right. I could add special handling for symbols starting with ?, but I’m not sure what the scope should be - current file? Top-level form? I’m also not sure if variables with that naming convention are used in other ways.

mikejcusack20:03:24

Those are my questions as well

robert-stuttaford10:03:39

afaik ?anything is a valid Clojure symbol, so i'd say the scope would be the same as any other Clojure symbol

robert-stuttaford10:03:57

i think core.logic uses this convention as well

robert-stuttaford10:03:28

you could stop quoting your Datalog queries if you had a def for each ?thing 🙂

mikejcusack19:03:18

I don't think that would be a good idea

cfleming19:03:20

Yes, ?anything is a valid symbol. But symbols on their own don’t have a scope, the scope is implied by the thing (fn, macro, datalog query, core.logic) using them. I have a similar problem with hiccup support - since everything is data, there’s nothing to say what is a datalog query in the code unless you pass an explicit data structure to a function which is well-known to accept one.

6
robert-stuttaford07:03:08

@U01NYKKE69G of course, it's a terrible idea 🙂 my point was, it would work because ?these ?are ?just ?symbols

aratare09:03:45

Hi there. I’ve come across some weird behaviour but not sure why it’s happening. So if I start a REPL with cursive when first start Intellij, I get Suppressed exit with no extra info. lein compile doesn’t make any difference. But if I run lein repl in a terminal then exit it, then suddenly cursive will allow me to start a REPL perfectly fine again. Has anyone seen anything like this? Thanks in advance.

mikejcusack14:03:09

What's your repl launch configuration?

aratare14:03:11

Pretty much the standard one

mikejcusack14:03:25

What is it literally

cfleming20:03:11

This sort of thing can be caused by lein plugins - are you using any?

aratare05:03:58

@U0567Q30W Just two actually: lein-cloverage and lein-eftest

cfleming05:03:34

I wonder if Cloverage might be causing that. Is the project.clj anywhere I can look at, or is it private?

aratare05:03:45

Ah I missed another one: lein-virgil

cfleming05:03:10

Thanks, I’ll try to import that and start a REPL to reproduce, I won’t get to it today though.

aratare05:03:22

Sure thing. Thanks a lot 🙂

aratare05:03:49

If you want I can make an issue with a bit more info?

cfleming05:03:11

That would be great, thanks.

👍 3