Is there an effective way to extract all the names used in a Clojure/ClojureScript for a refactoring (renaming driven) effort?

Viewed 31

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

Usually, I build the project by executing the command cider-jack-in-cljs in Emacs, choosing shadow-cljs, then shadow for REPL type, and, finally, app for the building option.

The project has some naming problems. Some names used for functions, variables, and namespaces were not ideal for the domain.

There is a desire to do a refactoring on the code base in order to improve names and conventions.

The Product Manager with domain expertise (but no CS skills) asked for the names so that he could do a review.

My initial idea was doing a bunch of git greps using clojure syntax to focus on the creation of names associated with variables, functions, or namespaces:

$ git grep "(ns "
$ git grep "(defn- "
$ git grep "(def "
$ git grep "(defn "

But I am not sure this is the best approach...

Why is this kind of a Clojure question?

Well, I am new to Clojure, but since Clojure keeps everything in a Lisp image and Lisps, in general, deal with symbols in smart ways (symbolic computation is all about that), I thought that there could be a better way to use Clojure for this.

Also, it can be an Emacs question... Since Emacs is so awesome and powerful, maybe there is some trick from Cider to help with this problem.

0 Answers
Related