This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-03-31
Channels
- # announcements (3)
- # babashka (75)
- # beginners (16)
- # calva (124)
- # cider (10)
- # clara (2)
- # clj-kondo (1)
- # cljdoc (4)
- # cljs-dev (14)
- # clojure (104)
- # clojure-australia (4)
- # clojure-czech (5)
- # clojure-europe (14)
- # clojure-germany (48)
- # clojure-nl (4)
- # clojure-serbia (4)
- # clojure-uk (34)
- # clojurescript (60)
- # community-development (16)
- # conjure (12)
- # core-async (34)
- # cursive (42)
- # data-science (7)
- # deps-new (9)
- # depstar (1)
- # emacs (11)
- # events (2)
- # fulcro (15)
- # graalvm (1)
- # inf-clojure (1)
- # jobs (3)
- # jobs-discuss (1)
- # joker (7)
- # juxt (8)
- # lsp (20)
- # malli (42)
- # meander (4)
- # off-topic (5)
- # pathom (2)
- # polylith (13)
- # re-frame (39)
- # reagent (9)
- # reitit (31)
- # releases (2)
- # rewrite-clj (23)
- # shadow-cljs (39)
- # spacemacs (11)
- # specter (6)
- # tools-deps (8)
- # xtdb (12)
what tricks do people have for cursive when you have macros that generate a bunch of symbols? I know you can teach intellij in simple cases as described here: https://cursive-ide.com/userguide/macros.html
not the answer you are looking for probably but disabling all "unresolved symbol" warnings works for me 😉
thanks I'll have a read of that. btw There was a bit of discussion in the recent defn cast about kondo and cursive and the overlap in some bits of functionality
One thing that’s not documented yet is the new Resolve as: None which will disable the warnings locally inside that macro form. This works well for DSL-style macros which define a lot of local symbols, but doesn’t help for macros which define global var-style ones.
I wonder if it would be useful/practical to have something like the following:
;;@resolve with-my-wrapper :as let
(defmacro with-my-wrapper [bindings & body]
,,,)
(with-my-wrapper [foo bar]
(do-stuff)) ;; <-- Cursive now knows to treat this like a `let` expression
Kind of like Java annotations, except it would be IDE-specific and wouldn’t affect how the code actually runs. Cursive would just check comments for a leading ;;@resolve
and then do the same thing as when you select Resolve As via the GUI.
Pros: automatically configures Cursive correctly when sharing code; alternative to generating stubs; avoids needing to regenerate stubs for same source
Cons: ???
- how would u "annotate" 3rd-party libs? fork them and use :git/url
, instead of :mvn/version
?
- how about closed source stuff, like datomic, where u only have access to the AOT compiled class files?
- as u said, it's an IDE-specific solution; it wouldn't work with most teams, because they are typically not homogenous editor-wise.
- using comments is a horrible hack, as we saw in other instances, like javadoc. it
- it's also not easy to process programmatically, because u would need to write a character level parser for the comment strings, as opposed to using the already existing clojure parser - u r also losing reflection capabilities, so for example editor tooling can't query a running clojure process about these formatting settings
I have a clojurescript project that when I open in IDEAJ and Cursive on my linux box it all works fine, but when I open it on windows it yellow underlines everything: What could I be missing between my linux install and windows install? It builds and runs fine, hot-realoading works etc. It's just cursive doesn't seem to like it. On Linux I do shadow-cljs pom to create the pom.xml and load that as the project file, did same on windows and it made no difference.
There are some suggestions of things to check here, does that help? https://cursive-ide.com/userguide/eap/troubleshooting.html#help-lots-of-symbols-don-t-resolve
@cfleming bug report. If deps.edn
has a map with extra keys, then cursive complains about The following errors were found during project resolve: /path/to/deps.edn:
. Example broken edn
'{org.clojure/clojurescript {:mvn/version "1.10.844"
#_:git/url ""
#_:sha "3fdaabedb1343f434b6cb4f75fa28e748f96eff0"
#_#_:local/root "/Users/mk/Downloads/clojurescript/"
#_#_:local/root "/Users/kommen/work/clojurescript/"}}
#:org.clojure{clojurescript {:mvn/version "1.10.844", "" "3fdaabedb1343f434b6cb4f75fa28e748f96eff0"}}
note that :git/url and :sha only have one #_
so the https line is not commented, neither the value of the sha itself
#_
only comments the very next form, so it ended up being a map with key "
and value "3fdaabedb1343f434b6cb4f75fa28e748f96eff0"
- not sure how that's parsed
That’s right - that’s what helios’s original comment shows at the end, the resulting map. Oddly, deps itself accepts this so I’m not sure why it would fail with Cursive since Cursive is getting that error back from deps. I’ll try to reproduce this and see if I can figure it out.
Interestingly, even though the CLI doesn’t produce an error, it doesn’t produce the right result either:
~/d/c/helios-deps-problem> cat deps.edn
{org.clojure/clojurescript {:mvn/version "1.10.844"
#_:git/url ""
#_:sha "3fdaabedb1343f434b6cb4f75fa28e748f96eff0"
#_#_:local/root "/Users/mk/Downloads/clojurescript/"
#_#_:local/root "/Users/kommen/work/clojurescript/"}}⏎
~/d/c/helios-deps-problem> clojure -Stree
org.clojure/clojure 1.10.3
. org.clojure/spec.alpha 0.2.194
. org.clojure/core.specs.alpha 0.2.56
~/d/c/helios-deps-problem> clojure -Spath
src:/Users/colin/.m2/repository/org/clojure/clojure/1.10.3/clojure-1.10.3.jar:/Users/colin/.m2/repository/org/clojure/core.specs.alpha/0.2.56/core.specs.alpha-0.2.56.jar:/Users/colin/.m2/repository/org/clojure/spec.alpha/0.2.194/spec.alpha-0.2.194.jar
I’d have expected it to pick up clojurescript
and just ignore the map entry it doesn’t understand. @U064X3EF3 might know why that is.
#_ is not valid edn
And deps.edn is read with the the edn reader
Not sure if that’s a clue
Actually I’m wrong!
The discard sequence is part of edn
I don’t recognize that error, don’t know what that is
@U0AD3JSHL I’m not seeing an error with this. Cursive imports without the CLJS dep but that’s because Deps doesn’t return it, as detailed above. I’m using CLI tools 1.10.3.810.
That error seems to be something to do with ssh. Do you have something in your user deps file which might cause deps to do something with ssh? The most likely candidate would be something with git and the new git shell integration, but that’s getting outside the realms of my deps CLI knowledge.
The error was about Maven so that doesn’t match up
That deps.edn above is wrong - missing the outer map with :deps key
in the original message the map had a quote, so i assumed it wasn't the whole deps.edn