Fork me on GitHub
#cursive
<
2021-06-15
>
Matthew Twomey02:06:08

Thanks, I am able to create the task and us it with lein from then command-line, but it doesn’t show up as a task in intellij / cursive - that’s what I’m trying to solve?

Matthew Twomey14:06:13

Just a follow on to this (in case someone comes across it later): It appears this isn’t possible with Cursive, as least at present: https://github.com/cursive-ide/cursive/issues/60

Matthew Twomey02:06:08

Thanks, I am able to create the task and us it with lein from then command-line, but it doesn’t show up as a task in intellij / cursive - that’s what I’m trying to solve?

thumbnail08:06:31

Where do I enter the cursive license? I'm renewing one but can't find the option 😅

thheller09:06:27

in the help -> register cursive menu

❤️ 2
simongray12:06:50

I wonder why regular quoting does remove highlighting of unresolved symbols, while syntax-quoting doesn’t? The content is quoted in both cases, so should it really make a difference?

cfleming05:06:22

Primarily because syntax-quoting is mostly used for code, and quoting is usually used for data. However it’s true that often the code isn’t valid, the most egregious case being CLJS macros where there’s no good way to tell if the macro is designed to generate Clojure or CLJS. This is something that I’ve gone back and forth on, and I’m open to persuasion on not marking inside syntax quotes.

Alex Miller (Clojure team)12:06:14

regular quoting will just leave the symbol unevaluated. syntax quoting resolves symbols to fully-qualified symbols, so here would resolve something like ?form to your-ns/?form . I think (?) what you're seeing there is that Cursive is marking your-ns/?form as an unknown var in your-ns.

simongray12:06:35

Hm… that makes sense

simongray12:06:52

Is there no way I can unquote inside a quoted data structure?

simongray12:06:18

The only reason I went with ` is because I would like to use ~

Alex Miller (Clojure team)12:06:33

I think you're asking to not resolve those symbols?

simongray12:06:44

yeah, basically

Alex Miller (Clojure team)12:06:06

if so, the typical way to do that in ` is to ~'

Alex Miller (Clojure team)12:06:53

which is terrible here of course :)

simongray12:06:37

yeah, but the only reason I am using ` is because I can’t unquote inside a regular quoted data structure. The other alternative is to quote every single symbol other than written-rep, which is tedious 😞

Alex Miller (Clojure team)12:06:46

there are multiple options here

Alex Miller (Clojure team)12:06:13

it's important to keep in mind that this is all data

Alex Miller (Clojure team)12:06:04

(into [:bgp ['?form :ontoloex/writtenRep written-rep]]
  '[[?form ...] ...])

simongray12:06:05

Yeah, that’s one way to do it 🙂

simongray12:06:10

But it seems like a workaround. It sure would be great if one could unquote inside a quoted data structure 😉

Alex Miller (Clojure team)12:06:44

it's the symbol resolution that you don't want

Alex Miller (Clojure team)12:06:12

you can use apply-template for something like this I believe

Alex Miller (Clojure team)12:06:23

(clojure.template/apply-template '[x] 
  '[:bgp
    [?form :ontolex/writtenRep x]
    [?word :ontolex/canonicalForm ?form] 
    ;; etc
    ] 
  [written-rep])

👍 3
simongray12:06:23

(apply-template '[written-rep]
                       '[:bgp
                         [?form :ontolex/writtenRep written-rep]
                         [?word :ontolex/canonicalForm ?form]
                         [?word :ontolex/evokes ?synset]
                         [?synset :ontolex/lexicalizedSense ?wordsense]
                         [?wordsense :ontolex/isSenseOf ?other-word]
                         [?other-word :ontolex/canonicalForm ?other-form]
                         [?other-form :ontolex/writtenRep ?other-rep]]
                       [written-rep])

simongray12:06:32

this does work, but it’s a little ugly 🙂

simongray12:06:49

Maybe a macro that quotes every symbol starting with a ? is in order?

simongray12:06:26

though that doesn’t help with cursive highlighting 😛

simongray12:06:41

nevermind, I think Aristotle actually supports a bindings map, so I’ll just use that

simongray12:06:50

thanks for helping out anyway, @alexmiller!

simongray12:06:09

And for introducting me to apply-template.

Matthew Twomey14:06:13

Just a follow on to this (in case someone comes across it later): It appears this isn’t possible with Cursive, as least at present: https://github.com/cursive-ide/cursive/issues/60

Joel15:06:39

I see an old git ticket for this bug I get a lot when loading files into REPL: (https://github.com/cursive-ide/cursive/issues/1286)

Error updating class definitions:
Execution error (NullPointerException) at java.util.concurrent.ConcurrentHashMap
Is this considered unfortunately "normal"?

onetom02:06:33

i've pasted the code example in the ticket into one of my freshly opened REPL tool windows and it did not print any exceptions.

onetom02:06:54

Im on the Jun 8 2021 IntelliJ Ultimate EAP, with Cursive 1.10.3-eap1-2021.2

onetom02:06:53

ah, if I send the expression from the editor, then the error appears.

Jeff Evans19:06:12

the default auto-import does (for instance): (:import (java.time LocalDate)) is there a way to tell it instead to do (:import java.time.LocalDate) (this is to adhere to our internal style guidelines)

onetom02:06:06

there is a Preferences / Editor / General / Auto Import dialog, but it only shows settings for a few languages and Clojure is not on the list. if this style choice ever becomes an option, i would probably expect to find it within this dialog.

cfleming05:06:00

There’s no option for this at the moment, but I have (somewhat) short-term plans for improving all the namespace rewriting stuff to make it more configurable and just all around better.

👍 5
3
indy20:06:21

Is it possible to add vars also in the breadcrumb navigation? I use breadcrumb navigation all the time when I'm writing JS. Navigating between functions becomes much faster and I can also quickly see all the vars in the ns at a glance without opening the Structure pane.

salam01:06:53

i use “⌘ F12” (Navigate | File Structure) to get an overview of the current namespace.

onetom02:06:15

+1 for Cmd-F12, because it allows narrowing by simply starting to type a substring of the identifier you are looking for

indy03:06:05

This is exactly what I was looking for. Thank you. It would be nice if this can also be made part of Breadcrumb navigation (`Jump to navigation bar`) like in other langs.

cfleming05:06:20

I’ve asked in the JetBrains slack how to do this.

indy05:06:11

Nice, thank you :)