Fork me on GitHub
#lsp
<
2024-05-21
>
andrea.crotti16:05:28

I'd like to replace the same string to a shared constant across a project, there isn't a magic way to do that right? there is cljr-extract-def that works on a single namespace but doesn't solve the issue entirely

ericdallo20:05:41

yep, AFAIK clj-kondo doesn't have string analysis element, so there is no easy way to clojure-lsp know all usages, probably a find-replace in your editor would be the best shot. I use embar-export a lot to these kind of replaces

andrea.crotti20:05:39

Yeah the find and replace it's easy, but it I move that constant to a new file I have to add the new require everywhere

andrea.crotti20:05:48

But that's probably scriptable as well

ericdallo20:05:09

that's more related to the move-form clojure-lsp feature, right? it's a command, but it's pretty simple ATM

geraldodev20:05:26

Changed routes from Vector to function. LSP is on-point. Very nice.

❤️ 3
clj-kondo 3
🚀 2