This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-10-20
Channels
- # announcements (10)
- # aws (4)
- # babashka (71)
- # beginners (30)
- # calva (61)
- # cherry (1)
- # cider (16)
- # clj-kondo (3)
- # clj-on-windows (4)
- # cljsrn (1)
- # clojure (28)
- # clojure-austin (2)
- # clojure-bay-area (1)
- # clojure-europe (45)
- # clojure-hungary (1)
- # clojure-nl (1)
- # clojure-norway (26)
- # clojure-sweden (14)
- # clojure-uk (11)
- # clojurescript (39)
- # core-async (3)
- # core-typed (11)
- # datomic (68)
- # fulcro (7)
- # keechma (1)
- # lsp (29)
- # malli (5)
- # off-topic (57)
- # other-languages (13)
- # pathom (4)
- # rdf (7)
- # reagent (7)
- # reitit (6)
- # releases (1)
- # schema (8)
- # shadow-cljs (86)
- # sql (22)
- # squint (1)
- # vim (8)
- # xtdb (12)
Is it possible to use cider-jack-in-cljs
with lein-shadow
? Maybe adding a custom task for the lein repl
action?
EDIT: I ended up replacing shadow-cljs with figwheel-main in the end. And it works perfectly with CIDER
M-.
jumping to a definition of a symbol of a .jar dependency opens that file, however when doing C-x C-f you're not inside of that dependency's source code, but in a folder with its .jar
Is there a way to M-.
into its source code?
I heard in LSP they unpack .jar and navigate there, for example, and that sounds good, can it be done with cider? (I'm using eglot instead of LSP)
I jumped to a function definition of aws/invoke and wanted to search project-wide (aws cli) usage of that function's arg
(I ended up not needing it, but I thought that having project's source at hand is useful, as I recalled wanting to explore project's source a couple of times before, and came to ask how to)
atm to do so I'm clonning projects locally and using :local/root to point to them, which is tedious
> I jumped to a function definition of aws/invoke and wanted to search project-wide (aws cli) usage of that function's arg
For clarity: so for dependency foo
and function bar
you want to find usages of bar
within foo
(and not within your project)?
and explore project foo
in other ways as-though it is another project source on disk
For full-blown interactive functionality, CIDER / refactor-nrepl aren't the best tool for the job. The reason being: they're based on runtime info, and we can't preemptively eval the whole classpath.
clojure-lsp is fine for this use case.
If you clone the repo as of the relevant commit/tag, of course you can have the full CIDER project for that repo, provided that you started a dedicated repl for it. I wouln't recommend :local/root
as much: it still doesn't mean that CIDER will analyze all those namespaces (it only has direct access to stuff that has been require
d or otherwise eval
ed)
And as a quick hack, you might have luck with a jar-specific grep
. It might not hard to build a little custom emacs feature: "grep within the jar containing the current buffer"
This might sound like a big limitation in CIDER, but IME your use case is very much rare. For those rare occasions you can clone, start a repl, and use interactive functionality all in the same Emacs session - no restarts!
It's also worth noting that CIDER has no real reason to "unpack" .jar to disk. In fact doing so would be very much dangerous - it can easily alter the classpath, resulting in opaque issues that would backfire later. tldr CIDER, because it co-habitates with the jvm/clojure runtimes, has to use certain cautions.
I hit this same limitation all the time. I’m maybe spoiled from other languages (like emacs-lisp and python) where it’s totally normal to M-.
into a 3rd-party library and then just poke around, maybe check out the README, etc.
In jars: I’ve noticed that dired
actually handles the jar pretty well. If I dive into some 3rd-party library clojure code, then open dired, then hit <enter> on the .jar
that it suggests, it goes into “Zip Archive” mode and allows me to see all the files in the jar and open any of them. Not as great as a git repo, but that has still been really useful for me!
hi guys. i have a project in which i start it with cider-jack-in-clj&cljs
, using a shadow
as my preferred build tool because it already starts the nREPL and configures the middleware and etc. but i'm noticing that, because of that, whenever i try to print something from the Clojure part of my application, it shows up on the ClojureScript REPL instead of the Clojure one. do you know if there's a way to configure so that it prints to the correct REPL?