cursive

Issues at: https://git.io/cursive-issues
2021-03-31T09:27:07.119100Z

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

➕ 1
imre 2021-03-31T09:31:16.119300Z

Subscribing to this. I am unaware of a way to do this now.

imre 2021-03-31T09:33:54.119500Z

https://www.youtube.com/watch?v=kt4haSH2xcs

thheller 2021-03-31T09:34:23.119700Z

not the answer you are looking for probably but disabling all "unresolved symbol" warnings works for me 😉

☝️ 1
😉 1
2021-03-31T09:38:16.120200Z

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

imre 2021-03-31T09:38:44.120400Z

Thanks, I'll look that up

2021-03-31T12:10:59.123700Z

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

2021-03-31T12:12:36.125100Z

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.

2021-03-31T12:15:45.126300Z

Pros: automatically configures Cursive correctly when sharing code; alternative to generating stubs; avoids needing to regenerate stubs for same source

2021-03-31T12:15:48.126500Z

Cons: ???

2021-03-31T12:32:10.128200Z

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.

helios 2021-03-31T13:32:16.129800Z

@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: <http://repo1.maven.org|repo1.maven.org>: nodename nor servname provided, or not known. Example broken edn

'{org.clojure/clojurescript {:mvn/version "1.10.844"
                               #_:git/url "<https://github.com/clojure/clojurescript>"
                               #_:sha "3fdaabedb1343f434b6cb4f75fa28e748f96eff0"
                               #_#_:local/root "/Users/mk/Downloads/clojurescript/"
                               #_#_:local/root "/Users/kommen/work/clojurescript/"}}
#:org.clojure{clojurescript {:mvn/version "1.10.844", "<https://github.com/clojure/clojurescript>" "3fdaabedb1343f434b6cb4f75fa28e748f96eff0"}}

helios 2021-03-31T13:32:45.129900Z

note that :git/url and :sha only have one #_ so the https line is not commented, neither the value of the sha itself

helios 2021-03-31T13:33:03.130100Z

putting #_ #_ fixed everything 🤷

onetom 2021-03-31T16:21:43.130600Z

why the shrug emoji? is it not clear why do u need 2 #_ forms?

onetom 2021-03-31T16:30:57.130800Z

- 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

onetom 2021-03-31T16:33:16.131Z

- 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

cfleming 2021-03-31T20:35:54.131300Z

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.

jcsims 2021-03-31T21:43:24.131600Z

#_ only comments the very next form, so it ended up being a map with key "<https://github.com/clojure/clojurescript>" and value "3fdaabedb1343f434b6cb4f75fa28e748f96eff0" - not sure how that's parsed

jcsims 2021-03-31T21:43:51.131800Z

i.e. :git/url and :sha are the only things commented out

jcsims 2021-03-31T21:44:03.132Z

(in the first two lines)

cfleming 2021-03-31T23:29:48.132300Z

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.