1

I have been using Clojure, ClojureScript, lein, shadow-cljs, Emacs, and CIDER to work on a Clojure/ClojureScript dynamic web app project.

There is the main repository, let's call it principal. And also a supporting repository, called supporting.

Ok. On my local ~/projects folder, I have ~/projects/principal/ and also ~/projects/supporting.

At some point, after building the project being on ~/projects/principal/, I am using the ClojureScript REPL to invoke a function from one of the dependencies, the supporting repository:

cljs.user> (supporting.core/my-function my-variable)

With the cursor on top of supporting.core/my-function I execute the command cider-find-var (bounded to M-.) . This is a cool command. It allows me to jump to see the definition of the function!

The only problem is where CIDER is pointing me:

Directory /Users/pedro/.m2/repository/supporting/1.2.15/

As you can see, it does not point to the "original source code" of the supporting repo. It actually points to the "compiled version" related to Maven (the output of lein install, if my understanding is correct).

But, as far as I know, it is not appropriate to edit this. I need to edit the original file pre-compile on a different folder.

How to make CIDER jump to the original editable pre-compiled repository?

Pedro Delfino
  • 2,421
  • 1
  • 15
  • 30
  • 2
    Have you tried https://stackoverflow.com/questions/17848059/can-you-have-leiningen-load-library-code-from-locally-checked-out-source ? E.g. put supporting under the checkouts of principal. I can't say, what emacs, cider, shadow-cljs make out of it, but at least it allows for easy library development with leiningen. – cfrick Sep 02 '22 at 04:52
  • Thank you, @cfrick. I have not tried this approach. I will try and them update my question (or post an answer, if it becomes a successful approach). – Pedro Delfino Sep 02 '22 at 12:25

0 Answers0