This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-05-22
Channels
- # announcements (1)
- # beginners (109)
- # boot (2)
- # calva (26)
- # cider (6)
- # circleci (6)
- # cljsrn (3)
- # clojure (77)
- # clojure-dev (5)
- # clojure-europe (28)
- # clojure-finland (1)
- # clojure-hamburg (1)
- # clojure-italy (21)
- # clojure-japan (13)
- # clojure-nl (36)
- # clojure-spec (22)
- # clojure-sweden (4)
- # clojure-uk (105)
- # clojurescript (91)
- # community-development (8)
- # cursive (60)
- # datascript (3)
- # datomic (4)
- # emacs (33)
- # fulcro (19)
- # graalvm (38)
- # hoplon (4)
- # instaparse (1)
- # jobs (1)
- # leiningen (22)
- # off-topic (14)
- # pathom (2)
- # perun (4)
- # planck (5)
- # re-frame (10)
- # reagent (1)
- # reitit (11)
- # rum (11)
- # shadow-cljs (97)
- # tools-deps (82)
- # vim (53)
I actually didn’t even know that ::keys
and ::a/keys
in destructuring was a thing - https://clojure.org/guides/destructuring makes no mention of it.
@tony.kay Actually… those cases should already be handled, and there are even tests for them. I’ll check what’s going on there.
@tony.kay Right, so I have a test that:
(let [{::keys [foo bar]} item] ...)
When ::foo
is renamed to :other/baz
, is changed to:
(let [{:keys [:other/baz ::bar]} item] ...)
That does work, I just tested it. Also:
(ns cursive-2178.core
(:require [clojure.string :as str]))
(let [{::str/keys [a b]} nil])
is correctly transformed to:
(let [{:keys [:other/baz ::str/b]} nil])
(I had forgotten those destructuring options even existed, but I did fix them back in the day)
That hasn’t changed since my memory fade-off point, since I had forgotten they were supported 🙂
(ns com.fulcrologic.fulcro.b
(:require
[clojure.spec.alpha :as s]))
(s/def ::y number?)
-----
(ns com.fulcrologic.fulcro.a
(:require
[com.fulcrologic.fulcro.b :as b]
[clojure.spec.alpha :as s]))
(s/def ::x int)
(defn f [{::keys [x]
::b/keys [y]}])
Also, while we’re talking CLJC…doc string lookup fails in IDE if you’re in a CLJS file that uses a func from a CLJC file
That keyword is used with s/def
, which means that they get treated as if they were definitions.
I see…so treating them like definitions is sort of like the problem of moving functions among nses
In fact, there’s an issue about that one - https://github.com/cursive-ide/cursive/issues/1908
Also, if you c/p some code around, Cursive isn’t smart enough to find that ::alias/keyword
can be required. So the only real way to check whether you missed a require for a aliased keyword is trying to load into the repl
Is anyone else having an issue where IntelliJ/Cursive keeps recategorizing resource directories as source directories? I’m trying to isolate the problem, and thought I’d ask.
@lennart.buit Yes, it would be nice if Cursive auto-prompted in that case, you’re right.
@kingmob No-one else has reported that, no. Are you manually categorising them as resource dirs? i.e. by right clicking in the project view?
@cfleming Yes, but it never lasts. It didn’t use to be a problem, but I can’t figure out what change caused it.
So when you sync your lein/deps project, Cursive will re-mark all the directories to what the project file specifies them as. Clojure doesn’t really make the distinction between source and resource folders, there was an issue about this ages ago, I’ll see if I can dig it up.
…because miscategorized dirs offend my librarian ancestors? 😄
It’s not that big a deal, it’s more like an itch that won’t go away.
Basically, Lein and IntelliJ treat resource folders in different ways. The tl;dr is you should just leave it as Cursive sets it 🙂
I must now slit my wrists with a sharp bookmark.
In all seriousness, thanks for checking, @cfleming!