This used to work:
:sort-ns
{:replace-paths ["development/src"]
:replace-deps {com.github.clojure-lsp/clojure-lsp {:mvn/version "RELEASE"}}
:exec-fn ws.lsp/clean-ns!
:exec-args {}}
but now when I run clojure -T:sort-ns I get this error:
Execution error (FileNotFoundException) at clojure-lsp.refactor.edit/eval15230$loading (edit.clj:1).
Could not locate rewrite_clj/node__init.class, rewrite_clj/node.clj or rewrite_clj/node.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
Now that rewrite-clj has a release, will LSP get a new release?
Already pushed to master this bump
I'm working on some new features for clojure-lsp that I intend to merge this week, then I'll do a new release
are you using latest version? Looks like some dependency issue, since rewrite-clj is pretty used in clojure-lsp, maybe checking the deps tree?
Well, I ran clojure -Sforce -T:sort-ns to make sure it was picking up the RELEASE but I can try an explicit version number there...
Deleted clojure-lsp artifacts from ~/.m2 and still get it:
> clojure -Sforce -T:sort-ns
Downloading: org/clojure/clojure/maven-metadata.xml from central
Downloading: org/clojure/clojure/maven-metadata.xml from sonatype
Downloading: com/github/clojure-lsp/clojure-lsp/maven-metadata.xml from clojars
Downloading: com/github/clojure-lsp/clojure-lsp/2025.04.23-18.16.46/clojure-lsp-2025.04.23-18.16.46.pom from clojars
Downloading: com/github/clojure-lsp/lsp4clj/1.11.0/lsp4clj-1.11.0.pom from clojars
Downloading: com/github/clojure-lsp/lsp4clj/1.11.0/lsp4clj-1.11.0.jar from clojars
Downloading: com/github/clojure-lsp/clojure-lsp/2025.04.23-18.16.46/clojure-lsp-2025.04.23-18.16.46.jar from clojars
Execution error (FileNotFoundException) at clojure-lsp.refactor.edit/eval15230$loading (edit.clj:1).
Could not locate rewrite_clj/node__init.class, rewrite_clj/node.clj or rewrite_clj/node.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.That's definitely downloading the latest version.
Hum, I wonder if it's related with clojure-lsp using git sha for rewrite-clj
https://github.com/clojure-lsp/clojure-lsp/blob/master/lib/deps.edn#L2
Oh, you can't use git deps in JAR files (with pom.xml)
hum, that sucks
I think we will need to wait for rewrite-clj release, @lee do you see any problems releasing the paredit improvements you did? it's been a while and it's working good on clojure-lsp so far, I don't mind being a beta release as well ๐
I could always use a git dep for clojure-lsp itself ๐
Apparently, that's not sufficient...
clojure -Sforce -T:sort-ns
Checking out: at 454c86a60336bd076e066c9bb6fb85fac2cec830
Execution error (FileNotFoundException) at ws.lsp/clean-ns! (lsp.clj:19).
Could not locate clojure_lsp/api__init.class, clojure_lsp/api.clj or clojure_lsp/api.cljc on classpath. Please check that namespaces with dashes use underscores in the Clojure file name. Do I need a different artifact?
ah yes, clojure-lsp is a mono-repo, there are the lib and cli modules, probably only cli is enough for you
so not sure that works, never tried
This works just fine:
:sort-ns
{:replace-paths ["development/src"]
:replace-deps {com.github.clojure-lsp/clojure-lsp
{:git/tag "2025.04.23-18.16.46"
:git/sha "454c86a"
:deps/root "cli"}
#_{:mvn/version "RELEASE"}}
:exec-fn ws.lsp/clean-ns!
:exec-args {}}
Thank you!Cleaned 140 namespaces -- oh, this is going to be a big PR ๐
I'm migrating from clojure.tools.logging to org.corfield.logging4j2 so all my nses are out of order after the global find'n'replace ๐
(halfway through reviewing the changes -- some of these nses haven't been touched since 2019!)
Hey ho! Glad Sean has a workaround, but yeah, it has been a while, huh? I can mark rewrite-clj paredit namespace as "experimental and subject to change" and cut a release sometime today or tomorrow.