This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # babashka (28)
- # beginners (169)
- # cider (3)
- # clara (2)
- # clojars (1)
- # clojure (198)
- # clojure-europe (2)
- # clojure-nl (6)
- # clojure-spec (29)
- # clojure-uk (21)
- # clojurescript (21)
- # clojurewerkz (1)
- # core-async (6)
- # cryogen (2)
- # datomic (4)
- # duct (1)
- # fulcro (26)
- # graalvm (1)
- # malli (1)
- # reitit (5)
- # spacemacs (21)
Maybe the right idea is to not alias namespaces or use :refer as i find the clojure(script) tooling ecosystem often fails to be able to create an explorable link for you. E.g There doesn't seem a reliable way to find usages for a function so i end up doing text based searches. If thats the case, maybe it would be better to have the tooling auto shorten the names and always use the full namespace.
did you post this to the right channel? sounds interesting, but seems to be responding to something that is not present here 🙂
Your right, im not responding to anything. I was just pointing an idea out there. I meant to post it here. The core issue is that i haven't found a consitant way to progmattical navigate clojure(script) projects. Whats the command to show all the places a function gets used in an arbitrary clojure(script) project? I have worked with 3 teams so far and not seen a solution nor heard of one talked about. Oh sure, lots of half solutions: grep, clj-refactor, etc.. But they all have cavets. In the end, I spend a lot of manual time on these issues.
I am assuming you want all the locations to refactor the name of a function, as you mentioned refactor.
I use helm and iedit for this when it's across the whole project. Start with a project search,
SPC / and use
C-c C-e in the helm results to edit the results in another buffer. Then you can use iedit or multiple cursors to create simultaneous edits. When done editing, then
C-c C-c saves all changes across the project.
If just changing within a namespace, I hide helm-swoop
SPC s s and
C-c C-e to edit the swoop results
I do mean specifically clojurescript. But I feel I have run up against times when clj refactor doesn't work in clj.
You just have to make sure that your code compiles properly before using clj-refactor
I don't feel that's what I have experienced. I feel I have tried to use it and in multiple cases it has errored out on code that complies. But it's lazy of me to say that without providing examples.
Since learning how to use the built in tools that Spacemacs provides my use of clj-refactor has plummeted. In fact I just removed it several months ago and haven't missed it at all. I think cycling parens was the last thing I used, then I realised I could just do it in Evil with the same number of keys. If using Holy mode with Spacemacs, then I assume there is a some small benefit to clj-refactor.
Though I'd have to agree that clj-refactor isn't that great, and I too end up just using good old project search and replace most of the time. Just faster, plus it let's me find comments and documentation as well and rename those too
@U0K064KQV I am aware that you can access all commands in Holy Mode, but I don't believe you can use Vim style editing in Holy Mode. That was what I was referred too when I said Evil replaced many Clojure specific refactoring for me. Sorry for the confusion. For example
s c ( [ to change a list to a vector.
Yes, things like helm-ag, iedit, buffer narrowing are ubiquitous for Holy and Evil. I use them and Vim style editing and clever-parens and a little bit of lisp state for the majority of my workflow. Combined, these tools allow me to use the same set of keybindings across multiple languages, lowering my cognitive load for using Emacs (the main reason I move from Holy to Evil)
The only thing that actually analyses my Clojure code, I think, is clj-kondo and the REPL of course :)
This is an example of the type programatic solution that I don't think it's reachable with text. https://github.com/borkdude/carve