editors

martinklepsch 2022-11-16T15:45:07.485529Z

Anyone know tools to rename namespaces in a codebase? (should include moving of file + updating all references)

snoe 2022-11-17T16:34:15.729789Z

It should work with clojure-lsp. If there is a problem hopefully we can get it captured as an issue.

martinklepsch 2022-11-17T17:05:38.354289Z

@snoe I’m super new to clojure-lsp, could you point me towards how I could do this?

pez 2022-11-17T17:06:06.925569Z

Calva is an easy way to do it with clojure-lsp.

pez 2022-11-17T17:07:03.243219Z

Have the cursor in the namespace symbol and press F2, write the new name, submit with enter. (EDITED, because I mis-remembered).

šŸ‘† 1
snoe 2022-11-17T17:41:31.660279Z

Editor's are responsible for how rename is called so that it can fit into their own ways of doing things. coc.nvim suggests nmap <leader>rn <Plug>(coc-rename) for instance, but if you are picking an editor calva is certainly the least amount of setup.

pez 2022-11-16T16:35:16.388919Z

I think I've seen it done using Cursive. Iirc it was an action on the renamed namespace symbol. So first edit that and then invoke this action. I could be remembering it wrong. Saw it in a pair programming session.

pez 2022-11-16T16:40:09.133059Z

In theory you should be able to do it with clojure-lsp, refactor -> rename. But I seem to recall some issue with that...

vemv 2022-11-16T17:46:19.183309Z

https://github.com/clojure-emacs/refactor-nrepl#rename-file-or-dir works fairly decently. you can invoke it from a repl like any other lib