This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-06-15
Channels
- # babashka (41)
- # beginners (47)
- # calva (7)
- # cider (5)
- # cljsrn (2)
- # clojure (38)
- # clojure-europe (74)
- # clojure-nl (2)
- # clojure-spec (1)
- # clojure-uk (38)
- # clojurescript (42)
- # component (30)
- # core-async (2)
- # cryogen (6)
- # cursive (47)
- # datahike (7)
- # datomic (18)
- # defnpodcast (1)
- # fulcro (17)
- # graalvm (8)
- # graphql (4)
- # helix (5)
- # honeysql (5)
- # introduce-yourself (1)
- # jobs (5)
- # jobs-discuss (4)
- # malli (20)
- # meander (4)
- # mental-health (1)
- # off-topic (41)
- # pathom (18)
- # podcasts-discuss (2)
- # re-frame (20)
- # react (1)
- # reagent (22)
- # reitit (2)
- # releases (2)
- # remote-jobs (1)
- # reveal (2)
- # sci (10)
- # shadow-cljs (42)
- # sql (20)
- # tools-deps (7)
- # vim (2)
- # xtdb (51)
Hi @mtwomey, check out this answer on Stack Overflow: https://stackoverflow.com/questions/31175396/define-project-specific-tasks-in-leiningen
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?
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
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?
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?
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.
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.
I think you're asking to not resolve those symbols?
if so, the typical way to do that in ` is to ~'
so ... ~'?form ...
which is terrible here of course :)
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 😞
there are multiple options here
it's important to keep in mind that this is all data
(into [:bgp ['?form :ontoloex/writtenRep written-rep]]
'[[?form ...] ...])
But it seems like a workaround. It sure would be great if one could unquote inside a quoted data structure 😉
well you can, that's ~
it's the symbol resolution that you don't want
another option is the little-used http://clojure.github.io/clojure/clojure.template-api.html
you can use apply-template for something like this I believe
(clojure.template/apply-template '[x]
'[:bgp
[?form :ontolex/writtenRep x]
[?word :ontolex/canonicalForm ?form]
;; etc
]
[written-rep])
(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])
nevermind, I think Aristotle actually supports a bindings map, so I’ll just use that
thanks for helping out anyway, @alexmiller!
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
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"?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.
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)
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.
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.
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.
+1 for Cmd-F12, because it allows narrowing by simply starting to type a substring of the identifier you are looking for