Fork me on GitHub
#cursive
<
2023-03-16
>
tlonist08:03:19

is there a way to automatically update namespace upon changing its enclosing package name?

onetom08:03:35

i don't think it's currently supported. if u rename only the last segment of the namespace name, that will propagate though. otherwise 1. u would need to fall back to lower level file and text editing operations 2. use the rename NS refactoring support in CIDER/clojure-mode 3. clojure-lsp also supports such NS rename refactoring for awhile Disclaimer: I never actually tried 2. or 3. but I did read about these features in docs or release notes on twitter

2
tlonist09:03:30

thanks, I want to try 3. Is clojure-lsp a langauge server need to be run separately?

onetom09:03:34

i have practically 0 LSP server experience, but what i meant is u would need to use VS Code or Emacs as the LSP client. i know there is some LSP support for intellij, but i don't think it's ready to be used with clojure-lsp, especially alongside Cursive. but again, im not an expert on the topic of LSP

onetom09:03:36

let us know, if u could figure this out, because like once a month i would love to do such an operation myself too!

tlonist09:03:56

got it, thanks

onetom09:03:56

btw, i never used those other, smarter, automated NS rename solution, because the Replace in Files... action in IntelliJ is sufficiently effective, since it allows in-place editing of the search/replace results, so i can do additional adjustments to the replaced version of the code, if needed, like adding line breaks or changing the :as part and what not...

tlonist00:03:00

I'm undergoing a big refactoring and all these manual find and replace can be done in a single finger snap if there is such a solution. unfortunately I haven't found one yet. Opted to use vscode's replace symbol at the moment.

👍 2