lsp

enn 2026-04-16T21:59:04.952099Z

I have a library function x which is used in many places in my code. I would like to replace all of those calls with calls to my-x-wrapper , adding the relevant namespace to my ns :require as necessary. It's not quite an lsp-rename because I don't control the definition of x. Is there a way to do this with lsp or do I need to break out rewrite-clj?

borkdude 2026-04-16T22:17:19.209139Z

I think LSP would be in a good place to support this, if it's not supported right now, similar to rename. Maybe something named as "replace call" or "replace reference" or whatever. It's would be a useful feature imo.

ericdallo 2026-04-17T01:11:43.033859Z

interesting, sounds like a good code action "Replace call" indeed, feel free to open a issue about it, using examples if possible

borkdude 2026-04-17T08:09:17.713849Z

@ericdallo I was thinking "replace reference" may be better since not all vars are used in calls, like just (map foo/bar ...) or even {:fn foo/bar} ?

ericdallo 2026-04-17T13:15:34.856389Z

got it makes sense