https://clojurians.slack.com/archives/CHY97NXE2/p1607035161058100
I'm guessing there's a usage for clj and cljs ontop of each other. So a rename should be looking for all matching usages but it might be looking for the first
@snoe is that latin for my fault? any suggestions?
This is the expected behavior, lsp-mode just change the occurrences
I have a little workaround for this, but it seems emacs users doesn't like that automatic stuff change buffer without their permission
https://github.com/ericdallo/dotfiles/blob/master/.doom.d/config.el#L192
You can open an issue for lsp-mode
requesting this optional feature too đ
i mean, i donât like âautomaticâ necessarily, but manually opening a dozen buffers and hitting save is crazy
yeah, I agree with you, that's why I implemented that workaround, but I think I should have opened a PR on lsp-mode for that đ
as long as iâve got you, hereâs another one: I am running into some weirdness with cljc + cljs + clj
I have a shared-src dir containing cljc, a src dir containing clj, and a ui dir containing cljs. References seem to be understood between shared-src and clj, but not cljs
hum, you rename a reference from one dir and it's not reflected in other dir, you mean?
for me C-x s
runs save-some-buffers
which will save all dirty buffers
separate from the rename issue â usages for instance donât seem to be understood
Iâll see something like âunusedâ in the gutter, but then if I go hunting, I see it is used on the cljs side. This doesnât happen with the plain clj side. cljc and clj work, but the cljc and cljs doesnât.
I see, it seems lsp is loading separate workspaces for each folder
you need to load the root folder as the lsp project root or tell clojure-lsp to use multiple classpaths I think
https://github.com/snoe/clojure-lsp#initializationoptions, search for source-paths
how do I reset that info? I do have all of the folders configured as source paths. I have a project.clj and a shadow-cljs.
{:dependency-scheme "jar"
:source-paths #{"shared-src" "src" "ui-src" "dev" "test"}
;; :project-specs [{:project-path "shadow-cljs.edn"
;; :classpath-cmd ["npx shadow-cljs" "classpath"]}]
;; :project-specs [{:project-path "project.clj"
;; :classpath-cmd ["lein" "classpath"]}]
}
(When I say âhow do I reset that info?â I mean, how do I reset what folder is being recognized, like itâs a new project Iâm opening for the first time)
I think to reset you can M-x
lsp-workspace-folders-remove
is that just like deleting .lsp?
> WARN clojure-lsp.crawler: Error while looking up classpath info in /path/to/project Cannot run program âshadow-cljsâ (in directory â/path/to/projectâ): error=2, No such file or directory > http://java.io.IOException: Cannot run program âshadow-cljsâ (in directory â/path/to/projectâ): error=2, No such file or directory
well well well, found this in /tmp/lsp.out
it seems the root cause of you issue indeed đ
now the question is why
mm, i expect it should be trying to run npx shadow-cljs classpath
so the real question is how to fix it đ
https://github.com/snoe/clojure-lsp/blob/7f28cb3e14ab271eb62cc7afb06fee4bcd239087/src/clojure_lsp/crawler.clj#L253 looks relevant
yes, but I have no context about shadow-cljs đ
maybe @snoe could help later
i guess i can try to just include multiple project specs in the .lsp/config.edn
gonna try that
now im curious if itâs going to just barf because im using node modules with requires like [âfoo/barâ :as Bar]
it seems to be taking a long time to boot up this time, so thatâs either a good sign or a bad one đ
it used to barf on string imports. i'm not sure if that's been patched on not
I do see a whole lot of this: > WARN clojure-lsp.parser: params nil [{:or {tempid? (constantly false), depth 0}, :clojure.core/keys [js-name depth ident-transform parent-children tempid?], :keys [type children key dispatch-key params union-key query]}] > WARN clojure-lsp.parser: Cannot parse jar:file:///Users/devn/.m2/repository/com/wsscode/pathom/2.2.31/pathom-2.2.31.jar!/com/wsscode/pathom/graphql.cljc
Well, > INFO clojure-lsp.crawler: starting clj-kondo project classpath scan (this takes awhile) > ERROR clojure-lsp.main: #error { > :cause Java heap space > :via > [{:type java.lang.OutOfMemoryError > :message Java heap space}] > :trace > []} > DEBUG clojure-lsp.main: :initialize 353083 ()
setting jvm-opts to 5G from 2G to see if it can complete