cursive

Issues at: https://git.io/cursive-issues
mikejcusack 2021-03-03T07:47:51.111300Z

That was a helpful video. I also find https://www.youtube.com/watch?v=gIoadGfm5T8 helpful. What I think would be more helpful is an explanation of the differences between switching namespaces or staying in the user namespace.

mikejcusack 2021-03-03T13:59:45.113400Z

Is there a way to get cljsjs function resolution to work? For things like (.useState js/React 0) it is saying that .useState cannot be resolved.

dnolen 2021-03-03T14:04:05.114200Z

minor thing - dotted aliases get a warning when defining a REPL using deps.edn - it works but it's a bit confusing

dnolen 2021-03-03T14:04:15.114500Z

i.e. foo.bar

alexmiller 2021-03-03T14:10:07.115600Z

aliases are keywords and according to the reader https://clojure.org/reference/reader, "They cannot contain '.' in the name part, or name classes."

alexmiller 2021-03-03T14:10:30.116Z

so I think that's actually a correct warning

alexmiller 2021-03-03T14:11:23.116800Z

@dnolen some reason you're not using namespaced aliases instead? :my/alias instead of :my.alias ?

dnolen 2021-03-03T14:12:37.117400Z

hrm ok, I don't think I realized that dot was restricted to the namespace part

alexmiller 2021-03-03T14:13:19.117700Z

not sure that's actually enforced anywhere

imre 2021-03-03T14:35:35.117800Z

What exactly does 'name classes' mean in that sentence?

imre 2021-03-03T14:40:26.118Z

I'm probably missing something obvious

alexmiller 2021-03-03T14:45:11.118200Z

:java.lang.String

imre 2021-03-03T14:46:53.118500Z

as in they should not match the name of a class?

alexmiller 2021-03-03T14:46:59.118700Z

yeah

alexmiller 2021-03-03T14:47:45.118900Z

reduce and java.lang.String are both symbols but follow different paths in resolution so class names are special cases. I assume keywords disallow class names for some place where this collides, but I don't actually know where. iow, I'm not totally sure why this restriction exists.

imre 2021-03-03T14:48:27.119100Z

I see, TIL 🙂 I still wonder why the doubling down there matters. If a keyword doesn't contain a period, it cannot be a class name either?

alexmiller 2021-03-03T14:48:51.119300Z

I guess you'd be more likely to run into a problem with destructuring keyword to symbol (let [{:keys [java.lang.String]} m] ...)

alexmiller 2021-03-03T14:49:31.119500Z

the period restriction I think is primarily intended to push hierarchical naming to namespaces, not in names

😀 1
imre 2021-03-03T14:50:28.119700Z

That's a good point re :keys. On that note, which one is more idiomatic, :keys [foo] or :keys [:foo]?

alexmiller 2021-03-03T14:50:36.119900Z

the former

imre 2021-03-03T14:51:01.120100Z

👍:skin-tone-3: thank you Alex

alexmiller 2021-03-03T14:51:58.120300Z

keywords were primarily (only?) allowed in :keys originally to support autoresolved keyword resolution

alexmiller 2021-03-03T14:52:43.120500Z

using ::keys or ::alias/keys etc is now preferred

borkdude 2021-03-03T16:09:22.121300Z

I also recently learned about that restriction. Honestly I think a lot of people are just using this without knowing this restriction. Tracking an issue about that here: https://github.com/clj-kondo/clj-kondo/issues/1179

serioga 2021-03-03T18:37:18.121600Z

but this harder to copy/paste or grep, unfortunately... https://clojurians.slack.com/archives/C0744GXCJ/p1614783163120500?thread_ts=1614780607.115600&cid=C0744GXCJ

cfleming 2021-03-03T20:52:04.121900Z

Not at the moment sorry, but I’m planning improvements in this area.

👍 1
mikejcusack 2021-03-03T20:53:24.122100Z

I did realize that changing it to (js/React.useState 0) doesn't throw the false positive

mikejcusack 2021-03-03T20:53:46.122300Z

But (js/document.getElementById ...) does throw the false positive

Jakub Holý 2021-03-03T21:44:05.126500Z

Hi @cfleming! What is the status of support for navigating to keywords? Mr. @smith.adriane is using namespaced keywords in #membrane for https://github.com/phronmophobic/membrane/issues/16#issuecomment-790070882 (i.e. an intent is [::some-kwd] and there is (defeffect :the.ns/some-kwd ...) ) is it possible to jump from the former to the latter? is/will there be a general support for that or does Cursive require per-framework extension? Thank you!!!

➕ 2
Jakub Holý 2021-03-04T18:20:58.128200Z

awesome!

phronmophobic 2021-03-03T21:50:41.127Z

It looks like https://cursive-ide.com/userguide/macros.html might have an answer. It seems like you can tell cursive how to resolve a symbol for a given macro. There's already built in support for the re-frame macros, I wonder if membrane could piggyback on one of those.

cfleming 2021-03-03T23:14:10.127300Z

Yes, I think so. I think resolving them as one of the re-frame forms should work. I think I’ll also add a generic keyword def that can be used for this purpose, since the re-frame ones will also affect the icon that’s shown in the structure view etc.

❤️ 1
🎉 2
cfleming 2021-03-03T23:29:43.127600Z

https://github.com/cursive-ide/cursive/issues/2519

❤️ 3