This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
Why does cursive say
a (in both cases) cannot be resolved here:
Is it a bug or is it really not resolved? (I am relatively new to clojure)
(defn f  (def a 1) a)
If I replace
defn f  with
do, cursive does not complain. I thought
defns had an implicit
@polymeris: Cursive is technically incorrect here (since the language does support what you’re doing) but it’s strongly discouraged.
def always creates a new top-level var in the namespace, which is almost certainly not what you want.
Hmm, is there any way to tell Cursive that I want completion in my
build.boot file? It complains it's outside source root, but I would have to make my whole project a source root so it would be under one, and that's not really an option. Is there something that could be done, or is it a limitation of Cursive and/or IntelliJ?
@jaen: im just learning intellij (by going thru all the video tutorials under https://www.jetbrains.com/idea/documentation/), but i also hit this issue... 😕
i guess the best u can do is to move out the logic from
build.boot under you source path, but if u r just writing some
#!/usr/bin/env boot script then it's not an option...
I was reading these issues but it's still not very clear what is the current recommendation to deal with symbols defined by macros?
One of the commenters mentioned that he is maintaining a gigantic
(declare) somewhere in their source to deal with this but im not sure what does he mean by it.
Where should I put that declare?
Does he actually means multiple declares across various files?
Can I somewhere specify which macros are defining symbols? (in a language facet maybe?)
Can I at least have tab completion for words which are already in the file/project?
For example I've already have
adi/select all over my code base...
I feel like Sublimes hyper-dumb auto-completion is more practical 😕
Doesn't the usual completion (it should show by default, if not then try ctrl+space) work?
Thanks, @cfleming... I was trying to have a local binding that is resolved at compile time (a "constant").
adi/select are resolvable.
that's kindof the meat of the application... 😕
having so many positives renders this whole "highlight unresolvable symbols" functionality useless... i hope it wont interfere too much with other functionality based on static analysis
@onetom: See https://github.com/cursive-ide/cursive/issues/38#issuecomment-26373091 and https://github.com/cursive-ide/cursive/issues/708#issuecomment-83769578 for a workaround for datomic
@jaen: I’ll add a fix for the
build.boot file, so at least Cursive doesn’t complain about it being outside source roots.
@jaen: That would only hide the warning. I need to investigate what’s required for proper boot file support.
I see. I thought there would be some way to let it resolve the vars as if was a normal Clojure source.
@jaen: I hope there will be, but I’m not sure how the indexing will work for files which are not under source roots.
Right, I imagine getting it right is a bigger undertaking and the "generate project.clj" hack works more than well enough.
I just hoped there would be some relatively easy way into ticking IntelliJ that
build.boot is a Clojure source.
I guess that makes sense, since
use 'd by boot when evaluating that file (or at least, it does something equivalent to that)
Since requires are idempotent in Clojure then maybe
(require 'boot.core) would work, but that sounds iffy.