This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-12-12
Channels
- # adventofcode (42)
- # aleph (10)
- # announcements (1)
- # asami (138)
- # babashka (7)
- # beginners (7)
- # biff (13)
- # cider (7)
- # clj-kondo (15)
- # clojure (53)
- # clojure-austin (11)
- # clojure-belgium (2)
- # clojure-europe (23)
- # clojure-nl (1)
- # clojure-norway (55)
- # clojure-sweden (5)
- # clojure-uk (4)
- # cryogen (7)
- # cursive (63)
- # datomic (5)
- # eastwood (6)
- # emacs (31)
- # fulcro (7)
- # hyperfiddle (9)
- # introduce-yourself (3)
- # java (11)
- # lsp (10)
- # malli (14)
- # membrane (35)
- # off-topic (13)
- # portal (12)
- # prelude (1)
- # releases (2)
- # ring-swagger (27)
- # shadow-cljs (8)
- # timbre (25)
Just in case I've missed something and can't figure it out - there's no support for this currently, is there? https://github.com/cursive-ide/cursive/issues/2193
Tried Alt+Enter - nothing. Tried ;;noinspection unused
- nothing.
Ugh, sorry, I’ve partially investigated this multiple times, but not got around to fixing it. I’ve moved this into the next release.
Not sure if this is the new IntelliJ or a Cursive change, but I notice now when I: 1. right click a folder and click create a new clojure file 2. type a namespace name 3. press enter That namespace is now at the root. This seems like a step backwards from the old behavior, where it would be in the right namespace based on the folder in 1.
A workaround is to press right arrow, so the text is not selected, and the namespace prefix therefore doesn't get replaced in 2.
have also noticed this, and mostly adapted to it w/the right arrow thing mentioned ^
Yes, I made this change recently, because the IntelliJ new package dialog does this. However, the fact that the text is selected initially is a pain, I’ll see if I can fix that.
Ok, there is absolutely no way to fix this without duplicating all the code involved - it’s all private and final. Would everyone prefer the old way this used to work?
While I'd prefer the old way, I think I'd rather get used to how it currently works and avoid some future breakage or maintenance issue arising from going against Jetbrains
> Would everyone prefer the old way this used to work? Haha, interesting to see if you'll be able to get a confirmation from all Cursive users here 😜. I'm fine with either or, hadn't noticed the change 😃
oh, just found this, because Im having the same issue, making wrong namespaces because of the change: https://clojurians.slack.com/archives/C0744GXCJ/p1707233059463129?thread_ts=1707233059.463129
would be great if the cursor just started at the end instead of having the text selected
working great! thanks!
is it possible for some extension points to be added to cursive leveraging the NREPL connection to my app? I'd love some way to add e.g. project defined documentation for keywords. Or, "goto definition" for keywords. Or, ... actually alot of my ideas are surrounding keywords 😂. But some way to add nrepl middleware for cursive where I can plug the handlers for those requests would be top tier.
A couple different places potentially. I use fulcro defattrs generally, so that would be nice for my own projects. I'm fairly certain that other projects have similar "def kwd" type calls too.
@U0567Q30W is this feature idea interesting / possible? I know next to nothing about IJ plugins and UI requirements so it could easily be technically infeasible for all I know... But if it's not that would be 🔥.
My apologies for this taking so long to get to. I’m not sure about making this pluggable, but Cursive does actually support this for some keyword use cases, e.g. spec:
(s/def :order/date inst?)
(s/def :deck/suit #{:club :diamond :heart :spade})
(s/valid? :order/date (Date.))
(s/conform :deck/suit :club)
Here, you can navigate to :order/deck, use find usages, etc. It requires me to add support for forms using this currently, I’d be interested to know if there are common cases that are missing.
There is https://plugins.jetbrains.com/plugin/18019-integrant which adds support for navigating to integrant component definitions. I use this and find it useful
I've recently retrofitted VSCode with kw-docs that I hand rolled for my work app for example. I've also added some goto-definition that goes to com.fulcrologic.rad.attributes/defattr
definitions.
This is probably also a pain to implement, but using the NREPL support from calva and some custom relation
> What I mean by that is, what’s the logic you’re using to populate that popup?
I have a function in my code that searches for defattr
s, and populates the popup with generically relevant information of all related defattrs
currently this requires a running repl connection, but it may be possible to just create static dumps of this as edn, if that's workable
So, you have features for: navigation (going to definitions based on some logic), documentation (generated based on some custom logic) and… is that last one completion?
I see, that one I could potentially do generically in Cursive, which would be a nice addition.
The issue with a lot of this is that Cursive doesn’t use the REPL for any of that functionality. So that makes it harder to hook into.
How do you calculate the related kws in the case of defattrs? I’m not really sure how those work.
I'm contemplating hooking that up with guardrails, but I've not had time free to make that happen yet. Anyway, just some ideas I've been messing with that would be awesome for cursive as well.
Absolutely, I’d like to try to support some of these, but I’ll have to think about how to do it. It’s not as simple as just hooking into nREPL, sadly.
there's another, potentially nearer at hand solution - using clojure-lsp? It already has support for library-specific metadata collection, and it's hooked into IJ. I think the important metadata from stuff like fulcro can be dumped as edn for completion/gotodef/docs
I'd have to check, but I think clojure-lsp has pluggable versions of all of the above
Here's an example of deffattr
in use: https://github.com/fulcrologic/fulcro-rad-demo/blob/main/src/shared/com/example/model/address.cljc
So in that case, I’m unsure what that’s doing. It looks like it’s defining a var and a keyword?
The var is a map... e.g.
(defattr state :address/state :enum
{ao/enumerated-values (set (keys states))
ao/identities #{:address/id}
ao/schema :production
ao/enumerated-labels states})
compiles to
(def state {::attr/qualified-key :address/state ::attr/type :enum ao/enumerated-values ...})
I'm not sure all fulcro people would like that, since I know one or two that still use specs, though I'm not sure if they use gotodef on those specs
There's typically an :something/id
type keyword, and anything with ao/identities #{:something/id}
is related, which may be across multiple files
e.g. in the address file, every property on an address has ao/identities #{:address/id}
Is it possible/reasonable for Cursive to recognize carriage returns in the REPL output and to move the cursor as would happen in a terminal window? This is for a simple text-based progress bar for some long running output.
A possible workaround is using this (which is supported by Cursive):
(println (str "Hello" \u001b "[1KWorld"))
from the issue
https://github.com/cursive-ide/cursive/issues/2555