lsp

:clojure-lsp: Clojure implementation of the Language Server Protocol: https://clojure-lsp.io/
snoe 2020-12-05T02:49:33.046800Z

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

devn 2020-12-06T11:05:54.047Z

@snoe is that latin for my fault? any suggestions?

ericdallo 2020-12-03T22:42:42.035700Z

This is the expected behavior, lsp-mode just change the occurrences

ericdallo 2020-12-03T22:43:18.035900Z

I have a little workaround for this, but it seems emacs users doesn't like that automatic stuff change buffer without their permission

ericdallo 2020-12-03T22:43:54.036400Z

You can open an issue for lsp-mode requesting this optional feature too 🙂

ericdallo 2020-12-03T22:44:06.036700Z

https://github.com/emacs-lsp/lsp-mode/issues

devn 2020-12-03T22:47:44.036900Z

i mean, i don’t like “automatic” necessarily, but manually opening a dozen buffers and hitting save is crazy

ericdallo 2020-12-03T22:48:46.037100Z

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 😅

devn 2020-12-03T22:50:40.037300Z

as long as i’ve got you, here’s another one: I am running into some weirdness with cljc + cljs + clj

devn 2020-12-03T22:51:09.037500Z

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

ericdallo 2020-12-03T22:57:45.037700Z

hum, you rename a reference from one dir and it's not reflected in other dir, you mean?

dpsutton 2020-12-03T22:58:34.037900Z

for me C-x s runs save-some-buffers which will save all dirty buffers

👍 1
☝️ 1
devn 2020-12-03T22:58:51.038100Z

separate from the rename issue — usages for instance don’t seem to be understood

devn 2020-12-03T22:59:42.038400Z

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.

ericdallo 2020-12-03T22:59:58.038600Z

I see, it seems lsp is loading separate workspaces for each folder

ericdallo 2020-12-03T23:00:25.038800Z

you need to load the root folder as the lsp project root or tell clojure-lsp to use multiple classpaths I think

ericdallo 2020-12-03T23:01:11.039Z

https://github.com/snoe/clojure-lsp#initializationoptions, search for source-paths

devn 2020-12-03T23:01:23.039300Z

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.

devn 2020-12-03T23:03:06.039500Z

{: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"]}]
}

devn 2020-12-03T23:04:21.039800Z

(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)

ericdallo 2020-12-03T23:04:38.040Z

I think to reset you can M-x lsp-workspace-folders-remove

devn 2020-12-03T23:05:21.040200Z

is that just like deleting .lsp?

devn 2020-12-03T23:10:11.040400Z

> 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

devn 2020-12-03T23:10:22.040600Z

well well well, found this in /tmp/lsp.out

ericdallo 2020-12-03T23:11:13.040800Z

it seems the root cause of you issue indeed 😕

devn 2020-12-03T23:11:27.041Z

now the question is why

devn 2020-12-03T23:11:55.041200Z

mm, i expect it should be trying to run npx shadow-cljs classpath

devn 2020-12-03T23:12:13.041400Z

so the real question is how to fix it 😄

ericdallo 2020-12-03T23:14:12.041900Z

yes, but I have no context about shadow-cljs 😕

ericdallo 2020-12-03T23:14:22.042100Z

maybe @snoe could help later

devn 2020-12-03T23:14:43.042300Z

i guess i can try to just include multiple project specs in the .lsp/config.edn

devn 2020-12-03T23:14:45.042500Z

gonna try that

devn 2020-12-03T23:18:32.042800Z

now im curious if it’s going to just barf because im using node modules with requires like [“foo/bar” :as Bar]

devn 2020-12-03T23:18:44.043Z

it seems to be taking a long time to boot up this time, so that’s either a good sign or a bad one 😄

dpsutton 2020-12-03T23:19:22.043200Z

it used to barf on string imports. i'm not sure if that's been patched on not

devn 2020-12-03T23:21:00.043400Z

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

devn 2020-12-03T23:21:59.043600Z

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 ()

devn 2020-12-03T23:26:07.043900Z

setting jvm-opts to 5G from 2G to see if it can complete